From d870527e1e113dd1419965e2ac781e6188833d4c Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Thu, 16 Sep 2021 12:18:45 +0200 Subject: [PATCH 1/3] Add erc2477 interface. --- common/config/rush/npm-shrinkwrap.json | 261 ++++++++++++------ .../src/contracts/ierc-2477.sol | 2 +- .../src/contracts/utils/selector.sol | 13 + .../src/contracts/xcert.sol | 1 + .../src/tests/utils/selector.test.ts | 13 + 5 files changed, 202 insertions(+), 88 deletions(-) diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index 513b90d23..47a71c8a1 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -7731,40 +7731,47 @@ "dependencies": { "ansi-regex": { "version": "4.1.0", - "bundled": true + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" }, "ansi-styles": { "version": "3.2.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "requires": { "color-convert": "^1.9.0" } }, "bindings": { "version": "1.5.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", "requires": { "file-uri-to-path": "1.0.0" } }, "bip66": { "version": "1.1.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", + "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", "requires": { "safe-buffer": "^5.0.1" } }, "bn.js": { "version": "4.11.8", - "bundled": true + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", + "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" }, "brorand": { "version": "1.1.0", - "bundled": true + "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", + "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" }, "browserify-aes": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", + "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -7776,19 +7783,23 @@ }, "buffer-from": { "version": "1.1.1", - "bundled": true + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" }, "buffer-xor": { "version": "1.0.3", - "bundled": true + "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", + "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" }, "camelcase": { "version": "5.3.1", - "bundled": true + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" }, "cipher-base": { "version": "1.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", + "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -7796,7 +7807,8 @@ }, "cliui": { "version": "5.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", + "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", "requires": { "string-width": "^3.1.0", "strip-ansi": "^5.2.0", @@ -7805,18 +7817,21 @@ }, "color-convert": { "version": "1.9.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "requires": { "color-name": "1.1.3" } }, "color-name": { "version": "1.1.3", - "bundled": true + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" }, "create-hash": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", + "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -7827,7 +7842,8 @@ }, "create-hmac": { "version": "1.1.7", - "bundled": true, + "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", + "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -7839,7 +7855,8 @@ }, "cross-spawn": { "version": "6.0.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -7850,11 +7867,13 @@ }, "decamelize": { "version": "1.2.0", - "bundled": true + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" }, "drbg.js": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", + "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", "requires": { "browserify-aes": "^1.0.6", "create-hash": "^1.1.2", @@ -7863,7 +7882,8 @@ }, "elliptic": { "version": "6.5.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", + "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -7876,18 +7896,21 @@ }, "emoji-regex": { "version": "7.0.3", - "bundled": true + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" }, "end-of-stream": { "version": "1.4.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", + "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", "requires": { "once": "^1.4.0" } }, "ethereumjs-util": { "version": "6.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", + "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", @@ -7900,7 +7923,8 @@ }, "ethjs-util": { "version": "0.1.6", - "bundled": true, + "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", + "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", "requires": { "is-hex-prefixed": "1.0.0", "strip-hex-prefix": "1.0.0" @@ -7908,7 +7932,8 @@ }, "evp_bytestokey": { "version": "1.0.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", + "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -7916,7 +7941,8 @@ }, "execa": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", + "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", "requires": { "cross-spawn": "^6.0.0", "get-stream": "^4.0.0", @@ -7929,29 +7955,34 @@ }, "file-uri-to-path": { "version": "1.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" }, "find-up": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "requires": { "locate-path": "^3.0.0" } }, "get-caller-file": { "version": "2.0.5", - "bundled": true + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, "get-stream": { "version": "4.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", "requires": { "pump": "^3.0.0" } }, "hash-base": { "version": "3.0.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", + "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -7959,7 +7990,8 @@ }, "hash.js": { "version": "1.1.7", - "bundled": true, + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", + "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -7967,7 +7999,8 @@ }, "hmac-drbg": { "version": "1.0.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -7976,31 +8009,38 @@ }, "inherits": { "version": "2.0.4", - "bundled": true + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" }, "invert-kv": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", + "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" }, "is-fullwidth-code-point": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" }, "is-hex-prefixed": { "version": "1.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", + "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" }, "is-stream": { "version": "1.1.0", - "bundled": true + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" }, "isexe": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" }, "keccak": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", + "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", "requires": { "bindings": "^1.2.1", "inherits": "^2.0.3", @@ -8010,14 +8050,16 @@ }, "lcid": { "version": "2.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", + "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", "requires": { "invert-kv": "^2.0.0" } }, "locate-path": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "requires": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -8025,14 +8067,16 @@ }, "map-age-cleaner": { "version": "0.1.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", + "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", "requires": { "p-defer": "^1.0.0" } }, "md5.js": { "version": "1.3.5", - "bundled": true, + "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", + "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -8041,7 +8085,8 @@ }, "mem": { "version": "4.3.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", @@ -8050,41 +8095,49 @@ }, "mimic-fn": { "version": "2.1.0", - "bundled": true + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" }, "minimalistic-assert": { "version": "1.0.1", - "bundled": true + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "minimalistic-crypto-utils": { "version": "1.0.1", - "bundled": true + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "nan": { "version": "2.14.0", - "bundled": true + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" }, "nice-try": { "version": "1.0.5", - "bundled": true + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" }, "npm-run-path": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", "requires": { "path-key": "^2.0.0" } }, "once": { "version": "1.4.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "requires": { "wrappy": "1" } }, "os-locale": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", + "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", "requires": { "execa": "^1.0.0", "lcid": "^2.0.0", @@ -8093,45 +8146,54 @@ }, "p-defer": { "version": "1.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", + "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" }, "p-finally": { "version": "1.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" }, "p-is-promise": { "version": "2.1.0", - "bundled": true + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" }, "p-limit": { "version": "2.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "requires": { "p-try": "^2.0.0" } }, "p-locate": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "requires": { "p-limit": "^2.0.0" } }, "p-try": { "version": "2.2.0", - "bundled": true + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" }, "path-exists": { "version": "3.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-key": { "version": "2.0.1", - "bundled": true + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" }, "pump": { "version": "3.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -8139,15 +8201,18 @@ }, "require-directory": { "version": "2.1.1", - "bundled": true + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" }, "require-main-filename": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" }, "ripemd160": { "version": "2.0.2", - "bundled": true, + "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", + "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -8155,7 +8220,8 @@ }, "rlp": { "version": "2.2.3", - "bundled": true, + "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", + "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", "requires": { "bn.js": "^4.11.1", "safe-buffer": "^5.1.1" @@ -8163,11 +8229,13 @@ }, "safe-buffer": { "version": "5.2.0", - "bundled": true + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", + "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" }, "secp256k1": { "version": "3.7.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", + "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", "requires": { "bindings": "^1.5.0", "bip66": "^1.1.5", @@ -8181,15 +8249,18 @@ }, "semver": { "version": "5.7.0", - "bundled": true + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" }, "set-blocking": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" }, "sha.js": { "version": "2.4.11", - "bundled": true, + "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", + "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -8197,26 +8268,31 @@ }, "shebang-command": { "version": "1.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "requires": { "shebang-regex": "^1.0.0" } }, "shebang-regex": { "version": "1.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" }, "signal-exit": { "version": "3.0.2", - "bundled": true + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" }, "source-map": { "version": "0.6.1", - "bundled": true + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" }, "source-map-support": { "version": "0.5.12", - "bundled": true, + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -8224,7 +8300,8 @@ }, "string-width": { "version": "3.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -8233,36 +8310,42 @@ }, "strip-ansi": { "version": "5.2.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "requires": { "ansi-regex": "^4.1.0" } }, "strip-eof": { "version": "1.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" }, "strip-hex-prefix": { "version": "1.0.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", + "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", "requires": { "is-hex-prefixed": "1.0.0" } }, "which": { "version": "1.3.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "requires": { "isexe": "^2.0.0" } }, "which-module": { "version": "2.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", + "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "wrap-ansi": { "version": "5.1.0", - "bundled": true, + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", + "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", "requires": { "ansi-styles": "^3.2.0", "string-width": "^3.0.0", @@ -8271,15 +8354,18 @@ }, "wrappy": { "version": "1.0.2", - "bundled": true + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" }, "y18n": { "version": "4.0.0", - "bundled": true + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" }, "yargs": { "version": "13.2.4", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", + "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", @@ -8296,7 +8382,8 @@ }, "yargs-parser": { "version": "13.1.1", - "bundled": true, + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", + "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" diff --git a/packages/0xcert-ethereum-xcert-contracts/src/contracts/ierc-2477.sol b/packages/0xcert-ethereum-xcert-contracts/src/contracts/ierc-2477.sol index 77b7e322c..6b99bd175 100644 --- a/packages/0xcert-ethereum-xcert-contracts/src/contracts/ierc-2477.sol +++ b/packages/0xcert-ethereum-xcert-contracts/src/contracts/ierc-2477.sol @@ -4,7 +4,7 @@ pragma solidity 0.8.6; /** * @title ERC-2477 Non-Fungible Token Metadata Integrity Standard * @dev See https://eips.ethereum.org/EIPS/eip-2477 - * @dev The ERC-165 identifier for this interface is 0x#######. //TODO: FIX THIS + * @dev The ERC-165 identifier for this interface is 0x832a7e0e */ interface ERC2477 /* is ERC165 */ { /** diff --git a/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol b/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol index cd5f9f67c..c928531c6 100644 --- a/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol +++ b/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol @@ -2,6 +2,7 @@ pragma solidity 0.8.6; +import "../ierc-2477.sol"; import "../ixcert.sol"; import "../ixcert-burnable.sol"; import "../ixcert-mutable.sol"; @@ -16,6 +17,18 @@ import "../ixcert-revokable.sol"; contract Selector { + /** + * @dev Calculates and returns interface ID for the erc2477 smart contract. + */ + function calculateERC2477Selector() + external + pure + returns (bytes4) + { + ERC2477 i; + return (i.tokenURIIntegrity.selector ^ i.tokenURISchemaIntegrity.selector); + } + /** * @dev Calculates and returns interface ID for the Xcert smart contract. */ diff --git a/packages/0xcert-ethereum-xcert-contracts/src/contracts/xcert.sol b/packages/0xcert-ethereum-xcert-contracts/src/contracts/xcert.sol index f54003229..0030bd9b7 100644 --- a/packages/0xcert-ethereum-xcert-contracts/src/contracts/xcert.sol +++ b/packages/0xcert-ethereum-xcert-contracts/src/contracts/xcert.sol @@ -156,6 +156,7 @@ contract XcertToken is constructor() { supportedInterfaces[0x39541724] = true; // Xcert + supportedInterfaces[0x832a7e0e] = true; // ERC2477 } /** diff --git a/packages/0xcert-ethereum-xcert-contracts/src/tests/utils/selector.test.ts b/packages/0xcert-ethereum-xcert-contracts/src/tests/utils/selector.test.ts index 65dfd5e64..217c12539 100644 --- a/packages/0xcert-ethereum-xcert-contracts/src/tests/utils/selector.test.ts +++ b/packages/0xcert-ethereum-xcert-contracts/src/tests/utils/selector.test.ts @@ -20,6 +20,19 @@ spec.beforeEach(async (ctx) => { ctx.set('selector', selector); }); +spec.test('checks erc2477 selector', async (ctx) => { + const selector = ctx.get('selector'); + const xcert = await ctx.deploy({ + src: './build/xcert-mock.json', + contract: 'XcertMock', + args: ['Foo', 'F', 'https://0xcert.org/', '.json', '0x9c22ff5f21f0b81b113e63f7db6da94fedef11b2119b4088b89664fb9a3cb658', []], + }); + + const bytes = await selector.instance.methods.calculateERC2477Selector().call(); + const supports = await xcert.instance.methods.supportsInterface(bytes).call(); + ctx.is(supports, true); +}); + spec.test('checks Xcert selector', async (ctx) => { const selector = ctx.get('selector'); const xcert = await ctx.deploy({ From 25b06202ac570271c7267d148850608d65c4a7d5 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Thu, 16 Sep 2021 12:54:57 +0200 Subject: [PATCH 2/3] Rebuild. --- common/config/rush/npm-shrinkwrap.json | 1508 ++++++++--------- dist/0xcert-ethereum-asset-ledger.min.js | 2 +- dist/0xcert-ethereum-gateway.min.js | 2 +- dist/0xcert-ethereum-http-provider.min.js | 2 +- dist/0xcert-ethereum-metamask-provider.min.js | 2 +- dist/0xcert-ethereum-value-ledger.min.js | 2 +- dist/0xcert-ethereum.min.js | 2 +- dist/0xcert-wanchain-asset-ledger.min.js | 2 +- dist/0xcert-wanchain-gateway.min.js | 2 +- dist/0xcert-wanchain-http-provider.min.js | 2 +- dist/0xcert-wanchain-value-ledger.min.js | 2 +- dist/0xcert-wanchain.min.js | 2 +- 12 files changed, 752 insertions(+), 778 deletions(-) diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index 47a71c8a1..076f61f25 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -13,24 +13,24 @@ } }, "@babel/compat-data": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.14.7.tgz", - "integrity": "sha512-nS6dZaISCXJ3+518CWiBfEr//gHyMO02uDxBkXTKZDN5POruCnOZ1N4YBRZDCabwF8nZMWBpRxIicmXtBs+fvw==" + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.15.0.tgz", + "integrity": "sha512-0NqAC1IJE0S0+lL1SWFMxMkz1pKCNCjI4tr2Zx4LJSXxCLAdr6KyArnY+sno5m3yH9g737ygOyPABDsnXkpxiA==" }, "@babel/core": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.8.tgz", - "integrity": "sha512-/AtaeEhT6ErpDhInbXmjHcUQXH0L0TEgscfcxk1qbOvLuKCa5aZT0SOOtDKFY96/CLROwbLSKyFor6idgNaU4Q==", + "version": "7.15.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.15.5.tgz", + "integrity": "sha512-pYgXxiwAgQpgM1bNkZsDEq85f0ggXMA5L7c+o3tskGMh2BunCI9QUwB9Z4jpvXUOuMdyGKiGKQiRe11VS6Jzvg==", "requires": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.8", - "@babel/helper-compilation-targets": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.8", - "@babel/helpers": "^7.14.8", - "@babel/parser": "^7.14.8", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.8", - "@babel/types": "^7.14.8", + "@babel/generator": "^7.15.4", + "@babel/helper-compilation-targets": "^7.15.4", + "@babel/helper-module-transforms": "^7.15.4", + "@babel/helpers": "^7.15.4", + "@babel/parser": "^7.15.5", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.2", @@ -47,6 +47,14 @@ "ms": "2.1.2" } }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", @@ -60,9 +68,9 @@ } }, "@babel/eslint-parser": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.14.7.tgz", - "integrity": "sha512-6WPwZqO5priAGIwV6msJcdc9TsEPzYeYdS/Xuoap+/ihkgN6dzHp2bcAAwyWZ5bLzk0vvjDmKvRwkqNaiJ8BiQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/eslint-parser/-/eslint-parser-7.15.4.tgz", + "integrity": "sha512-hPMIAmGNbmQzXJIo2P43Zj9UhRmGev5f9nqdBFOWNGDGh6XKmjby79woBvg6y0Jur6yRfQBneDbUQ8ZVc1krFw==", "requires": { "eslint-scope": "^5.1.1", "eslint-visitor-keys": "^2.1.0", @@ -77,38 +85,38 @@ } }, "@babel/generator": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.14.8.tgz", - "integrity": "sha512-cYDUpvIzhBVnMzRoY1fkSEhK/HmwEVwlyULYgn/tMQYd6Obag3ylCjONle3gdErfXBW61SVTlR9QR7uWlgeIkg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.15.4.tgz", + "integrity": "sha512-d3itta0tu+UayjEORPNz6e1T3FtvWlP5N4V5M+lhp/CxT4oAA7/NcScnpRyspUMLK6tu9MNHmQHxRykuN2R7hw==", "requires": { - "@babel/types": "^7.14.8", + "@babel/types": "^7.15.4", "jsesc": "^2.5.1", "source-map": "^0.5.0" } }, "@babel/helper-annotate-as-pure": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.14.5.tgz", - "integrity": "sha512-EivH9EgBIb+G8ij1B2jAwSH36WnGvkQSEC6CkX/6v6ZFlw5fVOHvsgGF4uiEHO2GzMvunZb6tDLQEQSdrdocrA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.15.4.tgz", + "integrity": "sha512-QwrtdNvUNsPCj2lfNQacsGSQvGX8ee1ttrBrcozUP2Sv/jylewBP/8QFe6ZkBsC8T/GYWonNAWJV4aRR9AL2DA==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-builder-binary-assignment-operator-visitor": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.14.5.tgz", - "integrity": "sha512-YTA/Twn0vBXDVGJuAX6PwW7x5zQei1luDDo2Pl6q1qZ7hVNl0RZrhHCQG/ArGpR29Vl7ETiB8eJyrvpuRp300w==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.15.4.tgz", + "integrity": "sha512-P8o7JP2Mzi0SdC6eWr1zF+AEYvrsZa7GSY1lTayjF5XJhVH0kjLYUZPvTMflP7tBgZoe9gIhTa60QwFpqh/E0Q==", "requires": { - "@babel/helper-explode-assignable-expression": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-explode-assignable-expression": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/helper-compilation-targets": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.14.5.tgz", - "integrity": "sha512-v+QtZqXEiOnpO6EYvlImB6zCD2Lel06RzOPzmkz/D/XgQiUu3C/Jb1LOqSt/AIA34TYi/Q+KlT8vTQrgdxkbLw==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.15.4.tgz", + "integrity": "sha512-rMWPCirulnPSe4d+gwdWXLfAXTTBj8M3guAf5xFQJ0nvFY7tfNAFnWdqaHegHlgDZOCT4qvhF3BYlSJag8yhqQ==", "requires": { - "@babel/compat-data": "^7.14.5", + "@babel/compat-data": "^7.15.0", "@babel/helper-validator-option": "^7.14.5", "browserslist": "^4.16.6", "semver": "^6.3.0" @@ -122,16 +130,16 @@ } }, "@babel/helper-create-class-features-plugin": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.14.8.tgz", - "integrity": "sha512-bpYvH8zJBWzeqi1o+co8qOrw+EXzQ/0c74gVmY205AWXy9nifHrOg77y+1zwxX5lXE7Icq4sPlSQ4O2kWBrteQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.15.4.tgz", + "integrity": "sha512-7ZmzFi+DwJx6A7mHRwbuucEYpyBwmh2Ca0RvI6z2+WLZYCqV0JOaLb+u0zbtmDicebgKBZgqbYfLaKNqSgv5Pw==", "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-member-expression-to-functions": "^7.14.7", - "@babel/helper-optimise-call-expression": "^7.14.5", - "@babel/helper-replace-supers": "^7.14.5", - "@babel/helper-split-export-declaration": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.15.4", + "@babel/helper-function-name": "^7.15.4", + "@babel/helper-member-expression-to-functions": "^7.15.4", + "@babel/helper-optimise-call-expression": "^7.15.4", + "@babel/helper-replace-supers": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4" } }, "@babel/helper-create-regexp-features-plugin": { @@ -179,76 +187,76 @@ } }, "@babel/helper-explode-assignable-expression": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.14.5.tgz", - "integrity": "sha512-Htb24gnGJdIGT4vnRKMdoXiOIlqOLmdiUYpAQ0mYfgVT/GDm8GOYhgi4GL+hMKrkiPRohO4ts34ELFsGAPQLDQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.15.4.tgz", + "integrity": "sha512-J14f/vq8+hdC2KoWLIQSsGrC9EFBKE4NFts8pfMpymfApds+fPqR30AOUWc4tyr56h9l/GA1Sxv2q3dLZWbQ/g==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-function-name": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.14.5.tgz", - "integrity": "sha512-Gjna0AsXWfFvrAuX+VKcN/aNNWonizBj39yGwUzVDVTlMYJMK2Wp6xdpy72mfArFq5uK+NOuexfzZlzI1z9+AQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.15.4.tgz", + "integrity": "sha512-Z91cOMM4DseLIGOnog+Z8OI6YseR9bua+HpvLAQ2XayUGU+neTtX+97caALaLdyu53I/fjhbeCnWnRH1O3jFOw==", "requires": { - "@babel/helper-get-function-arity": "^7.14.5", - "@babel/template": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-get-function-arity": "^7.15.4", + "@babel/template": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/helper-get-function-arity": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.14.5.tgz", - "integrity": "sha512-I1Db4Shst5lewOM4V+ZKJzQ0JGGaZ6VY1jYvMghRjqs6DWgxLCIyFt30GlnKkfUeFLpJt2vzbMVEXVSXlIFYUg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.15.4.tgz", + "integrity": "sha512-1/AlxSF92CmGZzHnC515hm4SirTxtpDnLEJ0UyEMgTMZN+6bxXKg04dKhiRx5Enel+SUA1G1t5Ed/yQia0efrA==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-hoist-variables": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.14.5.tgz", - "integrity": "sha512-R1PXiz31Uc0Vxy4OEOm07x0oSjKAdPPCh3tPivn/Eo8cvz6gveAeuyUUPB21Hoiif0uoPQSSdhIPS3352nvdyQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.15.4.tgz", + "integrity": "sha512-VTy085egb3jUGVK9ycIxQiPbquesq0HUQ+tPO0uv5mPEBZipk+5FkRKiWq5apuyTE9FUrjENB0rCf8y+n+UuhA==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-member-expression-to-functions": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.14.7.tgz", - "integrity": "sha512-TMUt4xKxJn6ccjcOW7c4hlwyJArizskAhoSTOCkA0uZ+KghIaci0Qg9R043kUMWI9mtQfgny+NQ5QATnZ+paaA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.15.4.tgz", + "integrity": "sha512-cokOMkxC/BTyNP1AlY25HuBWM32iCEsLPI4BHDpJCHHm1FU2E7dKWWIXJgQgSFiu4lp8q3bL1BIKwqkSUviqtA==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-module-imports": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.14.5.tgz", - "integrity": "sha512-SwrNHu5QWS84XlHwGYPDtCxcA0hrSlL2yhWYLgeOc0w7ccOl2qv4s/nARI0aYZW+bSwAL5CukeXA47B/1NKcnQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.15.4.tgz", + "integrity": "sha512-jeAHZbzUwdW/xHgHQ3QmWR4Jg6j15q4w/gCfwZvtqOxoo5DKtLHk8Bsf4c5RZRC7NmLEs+ohkdq8jFefuvIxAA==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-module-transforms": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.14.8.tgz", - "integrity": "sha512-RyE+NFOjXn5A9YU1dkpeBaduagTlZ0+fccnIcAGbv1KGUlReBj7utF7oEth8IdIBQPcux0DDgW5MFBH2xu9KcA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.15.4.tgz", + "integrity": "sha512-9fHHSGE9zTC++KuXLZcB5FKgvlV83Ox+NLUmQTawovwlJ85+QMhk1CnVk406CQVj97LaWod6KVjl2Sfgw9Aktw==", "requires": { - "@babel/helper-module-imports": "^7.14.5", - "@babel/helper-replace-supers": "^7.14.5", - "@babel/helper-simple-access": "^7.14.8", - "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.8", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.8", - "@babel/types": "^7.14.8" + "@babel/helper-module-imports": "^7.15.4", + "@babel/helper-replace-supers": "^7.15.4", + "@babel/helper-simple-access": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", + "@babel/helper-validator-identifier": "^7.14.9", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/helper-optimise-call-expression": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.14.5.tgz", - "integrity": "sha512-IqiLIrODUOdnPU9/F8ib1Fx2ohlgDhxnIDU7OEVi+kAbEZcyiF7BLU8W6PfvPi9LzztjS7kcbzbmL7oG8kD6VA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.15.4.tgz", + "integrity": "sha512-E/z9rfbAOt1vDW1DR7k4SzhzotVV5+qMciWV6LaG1g4jeFrkDlJedjtV4h0i4Q/ITnUu+Pk08M7fczsB9GXBDw==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-plugin-utils": { @@ -257,54 +265,54 @@ "integrity": "sha512-/37qQCE3K0vvZKwoK4XU/irIJQdIfCJuhU5eKnNxpFDsOkgFaUAwbv+RYw6eYgsC0E4hS7r5KqGULUogqui0fQ==" }, "@babel/helper-remap-async-to-generator": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.14.5.tgz", - "integrity": "sha512-rLQKdQU+HYlxBwQIj8dk4/0ENOUEhA/Z0l4hN8BexpvmSMN9oA9EagjnhnDpNsRdWCfjwa4mn/HyBXO9yhQP6A==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.15.4.tgz", + "integrity": "sha512-v53MxgvMK/HCwckJ1bZrq6dNKlmwlyRNYM6ypaRTdXWGOE2c1/SCa6dL/HimhPulGhZKw9W0QhREM583F/t0vQ==", "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-wrap-function": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-annotate-as-pure": "^7.15.4", + "@babel/helper-wrap-function": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/helper-replace-supers": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.14.5.tgz", - "integrity": "sha512-3i1Qe9/8x/hCHINujn+iuHy+mMRLoc77b2nI9TB0zjH1hvn9qGlXjWlggdwUcju36PkPCy/lpM7LLUdcTyH4Ow==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.15.4.tgz", + "integrity": "sha512-/ztT6khaXF37MS47fufrKvIsiQkx1LBRvSJNzRqmbyeZnTwU9qBxXYLaaT/6KaxfKhjs2Wy8kG8ZdsFUuWBjzw==", "requires": { - "@babel/helper-member-expression-to-functions": "^7.14.5", - "@babel/helper-optimise-call-expression": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-member-expression-to-functions": "^7.15.4", + "@babel/helper-optimise-call-expression": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/helper-simple-access": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.14.8.tgz", - "integrity": "sha512-TrFN4RHh9gnWEU+s7JloIho2T76GPwRHhdzOWLqTrMnlas8T9O7ec+oEDNsRXndOmru9ymH9DFrEOxpzPoSbdg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.15.4.tgz", + "integrity": "sha512-UzazrDoIVOZZcTeHHEPYrr1MvTR/K+wgLg6MY6e1CJyaRhbibftF6fR2KU2sFRtI/nERUZR9fBd6aKgBlIBaPg==", "requires": { - "@babel/types": "^7.14.8" + "@babel/types": "^7.15.4" } }, "@babel/helper-skip-transparent-expression-wrappers": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.14.5.tgz", - "integrity": "sha512-dmqZB7mrb94PZSAOYtr+ZN5qt5owZIAgqtoTuqiFbHFtxgEcmQlRJVI+bO++fciBunXtB6MK7HrzrfcAzIz2NQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.15.4.tgz", + "integrity": "sha512-BMRLsdh+D1/aap19TycS4eD1qELGrCBJwzaY9IE8LrpJtJb+H7rQkPIdsfgnMtLBA6DJls7X9z93Z4U8h7xw0A==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-split-export-declaration": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.14.5.tgz", - "integrity": "sha512-hprxVPu6e5Kdp2puZUmvOGjaLv9TCe58E/Fl6hRq4YiVQxIcNvuq6uTM2r1mT/oPskuS9CgR+I94sqAYv0NGKA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.15.4.tgz", + "integrity": "sha512-HsFqhLDZ08DxCpBdEVtKmywj6PQbwnF6HHybur0MAnkAKnlS6uHkwnmRIkElB2Owpfb4xL4NwDmDLFubueDXsw==", "requires": { - "@babel/types": "^7.14.5" + "@babel/types": "^7.15.4" } }, "@babel/helper-validator-identifier": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.8.tgz", - "integrity": "sha512-ZGy6/XQjllhYQrNw/3zfWRwZCTVSiBLZ9DHVZxn9n2gip/7ab8mv2TWlKPIBk26RwedCBoWdjLmn+t9na2Gcow==" + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.14.9.tgz", + "integrity": "sha512-pQYxPY0UP6IHISRitNe8bsijHex4TWZXi2HwKVsjPiltzlhse2znVcm9Ace510VT1kxIHjGJCZZQBX2gJDbo0g==" }, "@babel/helper-validator-option": { "version": "7.14.5", @@ -312,24 +320,24 @@ "integrity": "sha512-OX8D5eeX4XwcroVW45NMvoYaIuFI+GQpA2a8Gi+X/U/cDUIRsV37qQfF905F0htTRCREQIB4KqPeaveRJUl3Ow==" }, "@babel/helper-wrap-function": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.14.5.tgz", - "integrity": "sha512-YEdjTCq+LNuNS1WfxsDCNpgXkJaIyqco6DAelTUjT4f2KIWC1nBcaCaSdHTBqQVLnTBexBcVcFhLSU1KnYuePQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.15.4.tgz", + "integrity": "sha512-Y2o+H/hRV5W8QhIfTpRIBwl57y8PrZt6JM3V8FOo5qarjshHItyH5lXlpMfBfmBefOqSCpKZs/6Dxqp0E/U+uw==", "requires": { - "@babel/helper-function-name": "^7.14.5", - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/helper-function-name": "^7.15.4", + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/helpers": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.14.8.tgz", - "integrity": "sha512-ZRDmI56pnV+p1dH6d+UN6GINGz7Krps3+270qqI9UJ4wxYThfAIcI5i7j5vXC4FJ3Wap+S9qcebxeYiqn87DZw==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.15.4.tgz", + "integrity": "sha512-V45u6dqEJ3w2rlryYYXf6i9rQ5YMNu4FLS6ngs8ikblhu2VdR1AqAd6aJjBzmf2Qzh6KOLqKHxEN9+TFbAkAVQ==", "requires": { - "@babel/template": "^7.14.5", - "@babel/traverse": "^7.14.8", - "@babel/types": "^7.14.8" + "@babel/template": "^7.15.4", + "@babel/traverse": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/highlight": { @@ -389,27 +397,27 @@ } }, "@babel/parser": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.14.8.tgz", - "integrity": "sha512-syoCQFOoo/fzkWDeM0dLEZi5xqurb5vuyzwIMNZRNun+N/9A4cUZeQaE7dTrB8jGaKuJRBtEOajtnmw0I5hvvA==" + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.15.6.tgz", + "integrity": "sha512-S/TSCcsRuCkmpUuoWijua0Snt+f3ewU/8spLo+4AXJCZfT0bVCzLD5MuOKdrx0mlAptbKzn5AdgEIIKXxXkz9Q==" }, "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.14.5.tgz", - "integrity": "sha512-ZoJS2XCKPBfTmL122iP6NM9dOg+d4lc9fFk3zxc8iDjvt8Pk4+TlsHSKhIPf6X+L5ORCdBzqMZDjL/WHj7WknQ==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.15.4.tgz", + "integrity": "sha512-eBnpsl9tlhPhpI10kU06JHnrYXwg3+V6CaP2idsCXNef0aeslpqyITXQ74Vfk5uHgY7IG7XP0yIH8b42KSzHog==", "requires": { "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-skip-transparent-expression-wrappers": "^7.14.5", + "@babel/helper-skip-transparent-expression-wrappers": "^7.15.4", "@babel/plugin-proposal-optional-chaining": "^7.14.5" } }, "@babel/plugin-proposal-async-generator-functions": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.14.7.tgz", - "integrity": "sha512-RK8Wj7lXLY3bqei69/cc25gwS5puEc3dknoFPFbqfy3XxYQBQFvu4ioWpafMBAB+L9NyptQK4nMOa5Xz16og8Q==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.15.4.tgz", + "integrity": "sha512-2zt2g5vTXpMC3OmK6uyjvdXptbhBXfA77XGrd3gh93zwG8lZYBLOBImiGBEG0RANu3JqKEACCz5CGk73OJROBw==", "requires": { "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-remap-async-to-generator": "^7.14.5", + "@babel/helper-remap-async-to-generator": "^7.15.4", "@babel/plugin-syntax-async-generators": "^7.8.4" } }, @@ -423,21 +431,21 @@ } }, "@babel/plugin-proposal-class-static-block": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.14.5.tgz", - "integrity": "sha512-KBAH5ksEnYHCegqseI5N9skTdxgJdmDoAOc0uXa+4QMYKeZD0w5IARh4FMlTNtaHhbB8v+KzMdTgxMMzsIy6Yg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.15.4.tgz", + "integrity": "sha512-M682XWrrLNk3chXCjoPUQWOyYsB93B9z3mRyjtqqYJWDf2mfCdIYgDrA11cgNVhAQieaq6F2fn2f3wI0U4aTjA==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-create-class-features-plugin": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", "@babel/plugin-syntax-class-static-block": "^7.14.5" } }, "@babel/plugin-proposal-decorators": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.14.5.tgz", - "integrity": "sha512-LYz5nvQcvYeRVjui1Ykn28i+3aUiXwQ/3MGoEy0InTaz1pJo/lAzmIDXX+BQny/oufgHzJ6vnEEiXQ8KZjEVFg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-decorators/-/plugin-proposal-decorators-7.15.4.tgz", + "integrity": "sha512-WNER+YLs7avvRukEddhu5PSfSaMMimX2xBFgLQS7Bw16yrUxJGWidO9nQp+yLy9MVybg5Ba3BlhAw+BkdhpDmg==", "requires": { - "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-create-class-features-plugin": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", "@babel/plugin-syntax-decorators": "^7.14.5" } @@ -497,15 +505,15 @@ } }, "@babel/plugin-proposal-object-rest-spread": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.14.7.tgz", - "integrity": "sha512-082hsZz+sVabfmDWo1Oct1u1AgbKbUAyVgmX4otIc7bdsRgHBXwTwb3DpDmD4Eyyx6DNiuz5UAATT655k+kL5g==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.15.6.tgz", + "integrity": "sha512-qtOHo7A1Vt+O23qEAX+GdBpqaIuD3i9VRrWgCJeq7WO6H2d14EK3q11urj5Te2MAeK97nMiIdRpwd/ST4JFbNg==", "requires": { - "@babel/compat-data": "^7.14.7", - "@babel/helper-compilation-targets": "^7.14.5", + "@babel/compat-data": "^7.15.0", + "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", "@babel/plugin-syntax-object-rest-spread": "^7.8.3", - "@babel/plugin-transform-parameters": "^7.14.5" + "@babel/plugin-transform-parameters": "^7.15.4" } }, "@babel/plugin-proposal-optional-catch-binding": { @@ -537,12 +545,12 @@ } }, "@babel/plugin-proposal-private-property-in-object": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.14.5.tgz", - "integrity": "sha512-62EyfyA3WA0mZiF2e2IV9mc9Ghwxcg8YTu8BS4Wss4Y3PY725OmS9M0qLORbJwLqFtGh+jiE4wAmocK2CTUK2Q==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.15.4.tgz", + "integrity": "sha512-X0UTixkLf0PCCffxgu5/1RQyGGbgZuKoI+vXP4iSbJSYwPb7hu06omsFGBvQ9lJEvwgrxHdS8B5nbfcd8GyUNA==", "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-create-class-features-plugin": "^7.14.5", + "@babel/helper-annotate-as-pure": "^7.15.4", + "@babel/helper-create-class-features-plugin": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", "@babel/plugin-syntax-private-property-in-object": "^7.14.5" } @@ -711,24 +719,24 @@ } }, "@babel/plugin-transform-block-scoping": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.14.5.tgz", - "integrity": "sha512-LBYm4ZocNgoCqyxMLoOnwpsmQ18HWTQvql64t3GvMUzLQrNoV1BDG0lNftC8QKYERkZgCCT/7J5xWGObGAyHDw==", + "version": "7.15.3", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.15.3.tgz", + "integrity": "sha512-nBAzfZwZb4DkaGtOes1Up1nOAp9TDRRFw4XBzBBSG9QK7KVFmYzgj9o9sbPv7TX5ofL4Auq4wZnxCoPnI/lz2Q==", "requires": { "@babel/helper-plugin-utils": "^7.14.5" } }, "@babel/plugin-transform-classes": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.14.5.tgz", - "integrity": "sha512-J4VxKAMykM06K/64z9rwiL6xnBHgB1+FVspqvlgCdwD1KUbQNfszeKVVOMh59w3sztHYIZDgnhOC4WbdEfHFDA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.15.4.tgz", + "integrity": "sha512-Yjvhex8GzBmmPQUvpXRPWQ9WnxXgAFuZSrqOK/eJlOGIXwvv8H3UEdUigl1gb/bnjTrln+e8bkZUYCBt/xYlBg==", "requires": { - "@babel/helper-annotate-as-pure": "^7.14.5", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-optimise-call-expression": "^7.14.5", + "@babel/helper-annotate-as-pure": "^7.15.4", + "@babel/helper-function-name": "^7.15.4", + "@babel/helper-optimise-call-expression": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-replace-supers": "^7.14.5", - "@babel/helper-split-export-declaration": "^7.14.5", + "@babel/helper-replace-supers": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", "globals": "^11.1.0" }, "dependencies": { @@ -782,9 +790,9 @@ } }, "@babel/plugin-transform-for-of": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.14.5.tgz", - "integrity": "sha512-CfmqxSUZzBl0rSjpoQSFoR9UEj3HzbGuGNL21/iFTmjb5gFggJp3ph0xR1YBhexmLoKRHzgxuFvty2xdSt6gTA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.15.4.tgz", + "integrity": "sha512-DRTY9fA751AFBDh2oxydvVm4SYevs5ILTWLs6xKXps4Re/KG5nfUkr+TdHCrRWB8C69TlzVgA9b3RmGWmgN9LA==", "requires": { "@babel/helper-plugin-utils": "^7.14.5" } @@ -825,25 +833,25 @@ } }, "@babel/plugin-transform-modules-commonjs": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.14.5.tgz", - "integrity": "sha512-en8GfBtgnydoao2PS+87mKyw62k02k7kJ9ltbKe0fXTHrQmG6QZZflYuGI1VVG7sVpx4E1n7KBpNlPb8m78J+A==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.15.4.tgz", + "integrity": "sha512-qg4DPhwG8hKp4BbVDvX1s8cohM8a6Bvptu4l6Iingq5rW+yRUAhe/YRup/YcW2zCOlrysEWVhftIcKzrEZv3sA==", "requires": { - "@babel/helper-module-transforms": "^7.14.5", + "@babel/helper-module-transforms": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-simple-access": "^7.14.5", + "@babel/helper-simple-access": "^7.15.4", "babel-plugin-dynamic-import-node": "^2.3.3" } }, "@babel/plugin-transform-modules-systemjs": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.14.5.tgz", - "integrity": "sha512-mNMQdvBEE5DcMQaL5LbzXFMANrQjd2W7FPzg34Y4yEz7dBgdaC+9B84dSO+/1Wba98zoDbInctCDo4JGxz1VYA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.15.4.tgz", + "integrity": "sha512-fJUnlQrl/mezMneR72CKCgtOoahqGJNVKpompKwzv3BrEXdlPspTcyxrZ1XmDTIr9PpULrgEQo3qNKp6dW7ssw==", "requires": { - "@babel/helper-hoist-variables": "^7.14.5", - "@babel/helper-module-transforms": "^7.14.5", + "@babel/helper-hoist-variables": "^7.15.4", + "@babel/helper-module-transforms": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", - "@babel/helper-validator-identifier": "^7.14.5", + "@babel/helper-validator-identifier": "^7.14.9", "babel-plugin-dynamic-import-node": "^2.3.3" } }, @@ -857,9 +865,9 @@ } }, "@babel/plugin-transform-named-capturing-groups-regex": { - "version": "7.14.7", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.7.tgz", - "integrity": "sha512-DTNOTaS7TkW97xsDMrp7nycUVh6sn/eq22VaxWfEdzuEbRsiaOU0pqU7DlyUGHVsbQbSghvjKRpEl+nUCKGQSg==", + "version": "7.14.9", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.14.9.tgz", + "integrity": "sha512-l666wCVYO75mlAtGFfyFwnWmIXQm3kSH0C3IRnJqWcZbWkoihyAdDhFm2ZWaxWTqvBvhVFfJjMRQ0ez4oN1yYA==", "requires": { "@babel/helper-create-regexp-features-plugin": "^7.14.5" } @@ -882,9 +890,9 @@ } }, "@babel/plugin-transform-parameters": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.14.5.tgz", - "integrity": "sha512-Tl7LWdr6HUxTmzQtzuU14SqbgrSKmaR77M0OKyq4njZLQTPfOvzblNKyNkGwOfEFCEx7KeYHQHDI0P3F02IVkA==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.15.4.tgz", + "integrity": "sha512-9WB/GUTO6lvJU3XQsSr6J/WKvBC2hcs4Pew8YxZagi6GkTdniyqp8On5kqdK8MN0LMeu0mGbhPN+O049NV/9FQ==", "requires": { "@babel/helper-plugin-utils": "^7.14.5" } @@ -914,9 +922,9 @@ } }, "@babel/plugin-transform-runtime": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.14.5.tgz", - "integrity": "sha512-fPMBhh1AV8ZyneiCIA+wYYUH1arzlXR1UMcApjvchDhfKxhy2r2lReJv8uHEyihi4IFIGlr1Pdx7S5fkESDQsg==", + "version": "7.15.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.15.0.tgz", + "integrity": "sha512-sfHYkLGjhzWTq6xsuQ01oEsUYjkHRux9fW1iUA68dC7Qd8BS1Unq4aZ8itmQp95zUzIcyR2EbNMTzAicFj+guw==", "requires": { "@babel/helper-module-imports": "^7.14.5", "@babel/helper-plugin-utils": "^7.14.5", @@ -992,29 +1000,29 @@ } }, "@babel/preset-env": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.14.8.tgz", - "integrity": "sha512-a9aOppDU93oArQ51H+B8M1vH+tayZbuBqzjOhntGetZVa+4tTu5jp+XTwqHGG2lxslqomPYVSjIxQkFwXzgnxg==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.15.6.tgz", + "integrity": "sha512-L+6jcGn7EWu7zqaO2uoTDjjMBW+88FXzV8KvrBl2z6MtRNxlsmUNRlZPaNNPUTgqhyC5DHNFk/2Jmra+ublZWw==", "requires": { - "@babel/compat-data": "^7.14.7", - "@babel/helper-compilation-targets": "^7.14.5", + "@babel/compat-data": "^7.15.0", + "@babel/helper-compilation-targets": "^7.15.4", "@babel/helper-plugin-utils": "^7.14.5", "@babel/helper-validator-option": "^7.14.5", - "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.14.5", - "@babel/plugin-proposal-async-generator-functions": "^7.14.7", + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining": "^7.15.4", + "@babel/plugin-proposal-async-generator-functions": "^7.15.4", "@babel/plugin-proposal-class-properties": "^7.14.5", - "@babel/plugin-proposal-class-static-block": "^7.14.5", + "@babel/plugin-proposal-class-static-block": "^7.15.4", "@babel/plugin-proposal-dynamic-import": "^7.14.5", "@babel/plugin-proposal-export-namespace-from": "^7.14.5", "@babel/plugin-proposal-json-strings": "^7.14.5", "@babel/plugin-proposal-logical-assignment-operators": "^7.14.5", "@babel/plugin-proposal-nullish-coalescing-operator": "^7.14.5", "@babel/plugin-proposal-numeric-separator": "^7.14.5", - "@babel/plugin-proposal-object-rest-spread": "^7.14.7", + "@babel/plugin-proposal-object-rest-spread": "^7.15.6", "@babel/plugin-proposal-optional-catch-binding": "^7.14.5", "@babel/plugin-proposal-optional-chaining": "^7.14.5", "@babel/plugin-proposal-private-methods": "^7.14.5", - "@babel/plugin-proposal-private-property-in-object": "^7.14.5", + "@babel/plugin-proposal-private-property-in-object": "^7.15.4", "@babel/plugin-proposal-unicode-property-regex": "^7.14.5", "@babel/plugin-syntax-async-generators": "^7.8.4", "@babel/plugin-syntax-class-properties": "^7.12.13", @@ -1033,25 +1041,25 @@ "@babel/plugin-transform-arrow-functions": "^7.14.5", "@babel/plugin-transform-async-to-generator": "^7.14.5", "@babel/plugin-transform-block-scoped-functions": "^7.14.5", - "@babel/plugin-transform-block-scoping": "^7.14.5", - "@babel/plugin-transform-classes": "^7.14.5", + "@babel/plugin-transform-block-scoping": "^7.15.3", + "@babel/plugin-transform-classes": "^7.15.4", "@babel/plugin-transform-computed-properties": "^7.14.5", "@babel/plugin-transform-destructuring": "^7.14.7", "@babel/plugin-transform-dotall-regex": "^7.14.5", "@babel/plugin-transform-duplicate-keys": "^7.14.5", "@babel/plugin-transform-exponentiation-operator": "^7.14.5", - "@babel/plugin-transform-for-of": "^7.14.5", + "@babel/plugin-transform-for-of": "^7.15.4", "@babel/plugin-transform-function-name": "^7.14.5", "@babel/plugin-transform-literals": "^7.14.5", "@babel/plugin-transform-member-expression-literals": "^7.14.5", "@babel/plugin-transform-modules-amd": "^7.14.5", - "@babel/plugin-transform-modules-commonjs": "^7.14.5", - "@babel/plugin-transform-modules-systemjs": "^7.14.5", + "@babel/plugin-transform-modules-commonjs": "^7.15.4", + "@babel/plugin-transform-modules-systemjs": "^7.15.4", "@babel/plugin-transform-modules-umd": "^7.14.5", - "@babel/plugin-transform-named-capturing-groups-regex": "^7.14.7", + "@babel/plugin-transform-named-capturing-groups-regex": "^7.14.9", "@babel/plugin-transform-new-target": "^7.14.5", "@babel/plugin-transform-object-super": "^7.14.5", - "@babel/plugin-transform-parameters": "^7.14.5", + "@babel/plugin-transform-parameters": "^7.15.4", "@babel/plugin-transform-property-literals": "^7.14.5", "@babel/plugin-transform-regenerator": "^7.14.5", "@babel/plugin-transform-reserved-words": "^7.14.5", @@ -1063,11 +1071,11 @@ "@babel/plugin-transform-unicode-escapes": "^7.14.5", "@babel/plugin-transform-unicode-regex": "^7.14.5", "@babel/preset-modules": "^0.1.4", - "@babel/types": "^7.14.8", + "@babel/types": "^7.15.6", "babel-plugin-polyfill-corejs2": "^0.2.2", "babel-plugin-polyfill-corejs3": "^0.2.2", "babel-plugin-polyfill-regenerator": "^0.2.2", - "core-js-compat": "^3.15.0", + "core-js-compat": "^3.16.0", "semver": "^6.3.0" }, "dependencies": { @@ -1091,35 +1099,35 @@ } }, "@babel/runtime": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.14.8.tgz", - "integrity": "sha512-twj3L8Og5SaCRCErB4x4ajbvBIVV77CGeFglHpeg5WC5FF8TZzBWXtTJ4MqaD9QszLYTtr+IsaAL2rEUevb+eg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.15.4.tgz", + "integrity": "sha512-99catp6bHCaxr4sJ/DbTGgHS4+Rs2RVd2g7iOap6SLGPDknRK9ztKNsE/Fg6QhSeh1FGE5f6gHGQmvvn3I3xhw==", "requires": { "regenerator-runtime": "^0.13.4" } }, "@babel/template": { - "version": "7.14.5", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.14.5.tgz", - "integrity": "sha512-6Z3Po85sfxRGachLULUhOmvAaOo7xCvqGQtxINai2mEGPFm6pQ4z5QInFnUrRpfoSV60BnjyF5F3c+15fxFV1g==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.15.4.tgz", + "integrity": "sha512-UgBAfEa1oGuYgDIPM2G+aHa4Nlo9Lh6mGD2bDBGMTbYnc38vulXPuC1MGjYILIEmlwl6Rd+BPR9ee3gm20CBtg==", "requires": { "@babel/code-frame": "^7.14.5", - "@babel/parser": "^7.14.5", - "@babel/types": "^7.14.5" + "@babel/parser": "^7.15.4", + "@babel/types": "^7.15.4" } }, "@babel/traverse": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.14.8.tgz", - "integrity": "sha512-kexHhzCljJcFNn1KYAQ6A5wxMRzq9ebYpEDV4+WdNyr3i7O44tanbDOR/xjiG2F3sllan+LgwK+7OMk0EmydHg==", + "version": "7.15.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.15.4.tgz", + "integrity": "sha512-W6lQD8l4rUbQR/vYgSuCAE75ADyyQvOpFVsvPPdkhf6lATXAsQIG9YdtOcu8BB1dZ0LKu+Zo3c1wEcbKeuhdlA==", "requires": { "@babel/code-frame": "^7.14.5", - "@babel/generator": "^7.14.8", - "@babel/helper-function-name": "^7.14.5", - "@babel/helper-hoist-variables": "^7.14.5", - "@babel/helper-split-export-declaration": "^7.14.5", - "@babel/parser": "^7.14.8", - "@babel/types": "^7.14.8", + "@babel/generator": "^7.15.4", + "@babel/helper-function-name": "^7.15.4", + "@babel/helper-hoist-variables": "^7.15.4", + "@babel/helper-split-export-declaration": "^7.15.4", + "@babel/parser": "^7.15.4", + "@babel/types": "^7.15.4", "debug": "^4.1.0", "globals": "^11.1.0" }, @@ -1145,11 +1153,11 @@ } }, "@babel/types": { - "version": "7.14.8", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.14.8.tgz", - "integrity": "sha512-iob4soQa7dZw8nodR/KlOQkPh9S4I8RwCxwRIFuiMRYjOzH/KJzdUfDgz6cGi5dDaclXF4P2PAhCdrBJNIg68Q==", + "version": "7.15.6", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.15.6.tgz", + "integrity": "sha512-BPU+7QhqNjmWyDO0/vitH/CuhpV8ZmK1wpKva8nuyNF5MJfuRNWMc+hc14+u9xT93kvykMdncrJT19h74uB1Ig==", "requires": { - "@babel/helper-validator-identifier": "^7.14.8", + "@babel/helper-validator-identifier": "^7.14.9", "to-fast-properties": "^2.0.0" } }, @@ -1159,9 +1167,9 @@ "integrity": "sha512-5a6wqoJV/xEdbRNKVo6I4hO3VjyDq//8q2f9I6PBAvMesJHFauXDorcNCsr9RzvsZnaWi5NYCcfyqP1QeFHFbw==" }, "@discoveryjs/json-ext": { - "version": "0.5.3", - "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.3.tgz", - "integrity": "sha512-Fxt+AfXgjMoin2maPIYzFZnQjAXjAL0PHscM5pRTtatFqB+vZxAM9tLp2Optnuw3QOQC40jTNeGYFOMvyf7v9g==" + "version": "0.5.5", + "resolved": "https://registry.npmjs.org/@discoveryjs/json-ext/-/json-ext-0.5.5.tgz", + "integrity": "sha512-6nFkfkmSeV/rqSaS4oWHgmpnYw194f6hmWF5is6b0J1naJZoiD0NTc9AiUwPHvWsowkjuHErCZT1wa0jg+BLIA==" }, "@eslint/eslintrc": { "version": "0.2.2", @@ -1217,9 +1225,9 @@ } }, "@ethersproject/abstract-provider": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.0.tgz", - "integrity": "sha512-vPBR7HKUBY0lpdllIn7tLIzNN7DrVnhCLKSzY0l8WAwxz686m/aL7ASDzrVxV93GJtIub6N2t4dfZ29CkPOxgA==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.4.1.tgz", + "integrity": "sha512-3EedfKI3LVpjSKgAxoUaI+gB27frKsxzm+r21w9G60Ugk+3wVLQwhi1LsEJAKNV7WoZc8CIpNrATlL1QFABjtQ==", "requires": { "@ethersproject/bignumber": "^5.4.0", "@ethersproject/bytes": "^5.4.0", @@ -1231,9 +1239,9 @@ } }, "@ethersproject/abstract-signer": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.4.0.tgz", - "integrity": "sha512-AieQAzt05HJZS2bMofpuxMEp81AHufA5D6M4ScKwtolj041nrfIbIi8ciNW7+F59VYxXq+V4c3d568Q6l2m8ew==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.4.1.tgz", + "integrity": "sha512-SkkFL5HVq1k4/25dM+NWP9MILgohJCgGv5xT5AcRruGz4ILpfHeBtO/y6j+Z3UN/PAjDeb4P7E51Yh8wcGNLGA==", "requires": { "@ethersproject/abstract-provider": "^5.4.0", "@ethersproject/bignumber": "^5.4.0", @@ -1320,22 +1328,22 @@ } }, "@ethersproject/logger": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.0.tgz", - "integrity": "sha512-xYdWGGQ9P2cxBayt64d8LC8aPFJk6yWCawQi/4eJ4+oJdMMjEBMrIcIMZ9AxhwpPVmnBPrsB10PcXGmGAqgUEQ==" + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.4.1.tgz", + "integrity": "sha512-DZ+bRinnYLPw1yAC64oRl0QyVZj43QeHIhVKfD/+YwSz4wsv1pfwb5SOFjz+r710YEWzU6LrhuSjpSO+6PeE4A==" }, "@ethersproject/networks": { - "version": "5.4.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.1.tgz", - "integrity": "sha512-8SvowCKz9Uf4xC5DTKI8+il8lWqOr78kmiqAVLYT9lzB8aSmJHQMD1GSuJI0CW4hMAnzocpGpZLgiMdzsNSPig==", + "version": "5.4.2", + "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.4.2.tgz", + "integrity": "sha512-eekOhvJyBnuibfJnhtK46b8HimBc5+4gqpvd1/H9LEl7Q7/qhsIhM81dI9Fcnjpk3jB1aTy6bj0hz3cifhNeYw==", "requires": { "@ethersproject/logger": "^5.4.0" } }, "@ethersproject/properties": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.0.tgz", - "integrity": "sha512-7jczalGVRAJ+XSRvNA6D5sAwT4gavLq3OXPuV/74o3Rd2wuzSL035IMpIMgei4CYyBdialJMrTqkOnzccLHn4A==", + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.4.1.tgz", + "integrity": "sha512-cyCGlF8wWlIZyizsj2PpbJ9I7rIlUAfnHYwy/T90pdkSn/NFTa5YWZx2wTJBe9V7dD65dcrrEMisCRUJiq6n3w==", "requires": { "@ethersproject/logger": "^5.4.0" } @@ -2035,9 +2043,9 @@ }, "dependencies": { "arg": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.0.tgz", - "integrity": "sha512-4P8Zm2H+BRS+c/xX1LrHw0qKpEhdlZjLCgWy+d78T9vqa2Z2SiD2wMrYuWIAFy5IZUD7nnNXroRttz+0RzlrzQ==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/arg/-/arg-5.0.1.tgz", + "integrity": "sha512-e0hDa9H2Z9AwFkk2qDlwhoMYE4eToKarchkQHovNdLTCYMHZHeRjI71crOh+dio4K6u1IcwubQqo79Ga4CyAQA==" }, "ci-info": { "version": "3.2.0", @@ -2065,9 +2073,9 @@ } }, "jiti": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.11.0.tgz", - "integrity": "sha512-/2c7e61hxxTIN34UeHBB0LCJ5Tq64kgJDV7GR+++e8XRxCKRIKmB8tH6ww1W+Z6Kgd6By+C3RSCu1lXjbPT68A==" + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/jiti/-/jiti-1.12.0.tgz", + "integrity": "sha512-0yGfdPjYZ+RkYR9HRo9cbeS7UiOleg+1Wg0QNk0vOjeSaXNw0dKp7fz+JeqEpHjmFuTN48eh7bY0FsizSYOLDQ==" }, "jsonfile": { "version": "4.0.0", @@ -3380,9 +3388,14 @@ "integrity": "sha512-h4lTMgMJctJybDp8CQrxTUiiYmedihHWkjnF/8Pxseu2S6Nlfcy8kwboQ8yejh456rP2yWoEVm1sS/FVsfM48w==" }, "@types/json-schema": { - "version": "7.0.8", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.8.tgz", - "integrity": "sha512-YSBPTLTVm2e2OoQIDYx8HaeWJ5tTToLH67kXR7zYNGupXMEHa2++G8k+DczX2cFVgalypqtyZIcU19AFcmOpmg==" + "version": "7.0.9", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.9.tgz", + "integrity": "sha512-qcUXuemtEu+E5wZSJHNxUXeCZhAfXKQ41D+duX+VYPde7xyEVZci+/oXKJL13tnRs9lR2pr4fod59GT6/X1/yQ==" + }, + "@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha1-7ihweulOEdK4J7y+UnC86n8+ce4=" }, "@types/node": { "version": "14.14.20", @@ -3441,9 +3454,9 @@ } }, "@types/webpack": { - "version": "4.41.30", - "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.30.tgz", - "integrity": "sha512-GUHyY+pfuQ6haAfzu4S14F+R5iGRwN6b2FRNJY7U0NilmFAqbsOfK6j1HwuLBAqwRIT+pVdNDJGJ6e8rpp0KHA==", + "version": "4.41.31", + "resolved": "https://registry.npmjs.org/@types/webpack/-/webpack-4.41.31.tgz", + "integrity": "sha512-/i0J7sepXFIp1ZT7FjUGi1eXMCg8HCCzLJEQkKsOtbJFontsJLolBcDC+3qxn5pPwiCt1G0ZdRmYRzNBtvpuGQ==", "requires": { "@types/node": "*", "@types/tapable": "^1", @@ -3461,9 +3474,9 @@ } }, "@types/webpack-sources": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-2.1.1.tgz", - "integrity": "sha512-MjM1R6iuw8XaVbtkCBz0N349cyqBjJHCbQiOeppe3VBeFvxqs74RKHAVt9LkxTnUWc7YLZOEsUfPUnmK6SBPKQ==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@types/webpack-sources/-/webpack-sources-3.2.0.tgz", + "integrity": "sha512-Ft7YH3lEVRQ6ls8k4Ff1oB4jN6oy/XmU6tQISKdhfh+1mR+viZFphS6WL0IrtDOzvefmJg5a0s7ZQoRXwqTEFg==", "requires": { "@types/node": "*", "@types/source-list-map": "*", @@ -3917,9 +3930,9 @@ } }, "@webpack-cli/serve": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.1.tgz", - "integrity": "sha512-4vSVUiOPJLmr45S8rMGy7WDvpWxfFxfP/Qx/cxZFCfvoypTYpPPL1X8VIZMe0WTA+Jr7blUxwUSEZNkjoMTgSw==" + "version": "1.5.2", + "resolved": "https://registry.npmjs.org/@webpack-cli/serve/-/serve-1.5.2.tgz", + "integrity": "sha512-vgJ5OLWadI8aKjDlOH3rb+dYyPd2GTZuQC/Tihjct6F9GpXGZINo3Y/IVuZVTM1eDQB+/AOsjPUWH/WySDaXvw==" }, "@xtuc/ieee754": { "version": "1.2.0", @@ -4051,15 +4064,15 @@ "type-fest": "^0.21.3" } }, - "ansi-html": { - "version": "0.0.7", - "resolved": "https://registry.npmjs.org/ansi-html/-/ansi-html-0.0.7.tgz", - "integrity": "sha1-gTWEAhliqenm/QOflA0S9WynhZ4=" + "ansi-html-community": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/ansi-html-community/-/ansi-html-community-0.0.8.tgz", + "integrity": "sha512-1APHAyr3+PCamwNw3bXCPp4HFLONZt/yIH0sZp0/469KWNTEy+qN5jQ3GVX6DMZ1UXAi34yVwtTeaG/HpBuuzw==" }, "ansi-regex": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" }, "ansi-styles": { "version": "4.3.0", @@ -4275,9 +4288,9 @@ } }, "available-typed-arrays": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.4.tgz", - "integrity": "sha512-SA5mXJWrId1TaQjfxUYghbqQ/hYioKmLJvPJyDuYRtXXenFNMjj4hSSt1Cf1xsuXSXrtxrVC5Ot4eU6cOtBDdA==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==" }, "aws-sign2": { "version": "0.7.0", @@ -4290,11 +4303,11 @@ "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==" }, "axios": { - "version": "0.21.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.1.tgz", - "integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==", + "version": "0.21.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz", + "integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==", "requires": { - "follow-redirects": "^1.10.0" + "follow-redirects": "^1.14.0" } }, "babel-loader": { @@ -4334,9 +4347,9 @@ } }, "babel-plugin-polyfill-corejs3": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.3.tgz", - "integrity": "sha512-rCOFzEIJpJEAU14XCcV/erIf/wZQMmMT5l5vXOpL5uoznyOGfDIjPj6FVytMvtzaKSTSVKouOCTPJ5OMUZH30g==", + "version": "0.2.4", + "resolved": "https://registry.npmjs.org/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.2.4.tgz", + "integrity": "sha512-z3HnJE5TY/j4EFEa/qpQMSbcUJZ5JQi+3UFjXzn6pQCmIKc5Ug5j98SuYyH+m4xQnvKlMDIW4plLfgyVnd0IcQ==", "requires": { "@babel/helper-define-polyfill-provider": "^0.2.2", "core-js-compat": "^3.14.0" @@ -4648,15 +4661,15 @@ } }, "browserslist": { - "version": "4.16.6", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.16.6.tgz", - "integrity": "sha512-Wspk/PqO+4W9qp5iUTJsa1B/QrYn1keNCcEP5OvP7WBwT4KaDly0uONYmC6Xa3Z5IqnUgS0KcgLYu1l74x0ZXQ==", + "version": "4.17.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.17.0.tgz", + "integrity": "sha512-g2BJ2a0nEYvEFQC208q8mVAhfNwpZ5Mu8BwgtCdZKO3qx98HChmeg448fPdUzld8aFmfLgVh7yymqV+q1lJZ5g==", "requires": { - "caniuse-lite": "^1.0.30001219", - "colorette": "^1.2.2", - "electron-to-chromium": "^1.3.723", + "caniuse-lite": "^1.0.30001254", + "colorette": "^1.3.0", + "electron-to-chromium": "^1.3.830", "escalade": "^3.1.1", - "node-releases": "^1.1.71" + "node-releases": "^1.1.75" } }, "bs58": { @@ -4687,9 +4700,9 @@ } }, "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==" }, "buffer-json": { "version": "2.0.0", @@ -4773,9 +4786,9 @@ } }, "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" } @@ -4924,9 +4937,9 @@ }, "dependencies": { "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } }, @@ -4947,9 +4960,9 @@ } }, "caniuse-lite": { - "version": "1.0.30001248", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001248.tgz", - "integrity": "sha512-NwlQbJkxUFJ8nMErnGtT0QTM2TJ33xgz4KXJSMIrjXIbDVdaYueGyjOrLKRtJC+rTiWfi6j5cnZN1NBiSBJGNw==" + "version": "1.0.30001257", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001257.tgz", + "integrity": "sha512-JN49KplOgHSXpIsVSF+LUyhD8PUp6xPpAXeRrrcBh4KBeP7W864jHn6RvzJgDlrReyeVjMFJL3PLpPvKIxlIHA==" }, "caseless": { "version": "0.12.0", @@ -4957,9 +4970,9 @@ "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=" }, "chalk": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.1.tgz", - "integrity": "sha512-diHzdDKxcU+bAsUboHLPEDQiw0qEe0qd7SYUn3HgcFlWgbDcfLGswOHYeGrHKzG9z6UYf01d9VFMfZxPM1xZSg==", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5259,9 +5272,9 @@ } }, "colorette": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.2.2.tgz", - "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==" + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-1.4.0.tgz", + "integrity": "sha512-Y2oEozpomLn7Q3HFP7dpww7AtMJplbM9lGZP6RDfHqmbeRjiwRg4n6VM6j4KLmRke85uWEI7JqF17f3pqdRA0g==" }, "combined-stream": { "version": "1.0.8", @@ -5510,11 +5523,11 @@ "integrity": "sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==" }, "core-js-compat": { - "version": "3.15.2", - "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.15.2.tgz", - "integrity": "sha512-Wp+BJVvwopjI+A1EFqm2dwUmWYXrvucmtIB2LgXn/Rb+gWPKYxtmb4GKHGKG/KGF1eK9jfjzT38DITbTOCX/SQ==", + "version": "3.17.3", + "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.17.3.tgz", + "integrity": "sha512-+in61CKYs4hQERiADCJsdgewpdl/X0GhEX77pjKgbeibXviIt2oxEjTc8O2fqHX8mDdBrDvX8MYD/RYsBv4OiA==", "requires": { - "browserslist": "^4.16.6", + "browserslist": "^4.17.0", "semver": "7.0.0" }, "dependencies": { @@ -5939,9 +5952,9 @@ } }, "deep-is": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", - "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=" + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "deepmerge": { "version": "4.2.2", @@ -6123,9 +6136,9 @@ "integrity": "sha512-BSKB+TSpMpFI/HOxCNr1O8aMOTZ8hT3pM3GQ0w/mWRmkhEDSFJkkyzz4XQsBV44BChwGkrDfMyjVD0eA2aFV3w==" }, "domhandler": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.0.tgz", - "integrity": "sha512-zk7sgt970kzPks2Bf+dwT/PLzghLnsivb9CcxkvR8Mzr66Olr0Ofd8neSbglHJHaHa2MadfoSdNlKYAaafmWfA==", + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.2.2.tgz", + "integrity": "sha512-PzE9aBMsdZO8TK4BnuJwH0QT41wgMbRzuZrHUcpYncEjmQazq8QEaBWgLG7ZyC/DAZKEgglpIA6j4Qn/HmxS3w==", "requires": { "domelementtype": "^2.2.0" }, @@ -6156,9 +6169,9 @@ }, "dependencies": { "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } }, @@ -6240,9 +6253,9 @@ "integrity": "sha512-7vmuyh5+kuUyJKePhQfRQBhXV5Ce+RnaeeQArKu1EAMpL3WbgMt5WG6uQZpEVvYSSsxMXRKOewtDk9RaTKXRlA==" }, "electron-to-chromium": { - "version": "1.3.789", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.789.tgz", - "integrity": "sha512-lK4xn6C6ZF1kgLaC/EhOtC1MSKENExj3rMwGVnBTfHW81Z/Hb1Rge5YaWawN/YOXy3xCaESuE4KWSD50kOZ9rQ==" + "version": "1.3.840", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.840.tgz", + "integrity": "sha512-yRoUmTLDJnkIJx23xLY7GbSvnmDCq++NSuxHDQ0jiyDJ9YZBUGJcrdUqm+ZwZFzMbCciVzfem2N2AWiHJcWlbw==" }, "elliptic": { "version": "6.5.4", @@ -6367,21 +6380,23 @@ } }, "es-abstract": { - "version": "1.18.3", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.3.tgz", - "integrity": "sha512-nQIr12dxV7SSxE6r6f1l3DtAeEYdsGpps13dR0TwJg1S8gyp4ZPgy3FZcHBgbiQqnoqSTb+oC+kO4UQ0C/J8vw==", + "version": "1.18.6", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.18.6.tgz", + "integrity": "sha512-kAeIT4cku5eNLNuUKhlmtuk1/TRZvQoYccn6TO0cSVdf1kzB0T7+dYuVK9MWM7l+/53W2Q8M7N2c6MQvhXFcUQ==", "requires": { "call-bind": "^1.0.2", "es-to-primitive": "^1.2.1", "function-bind": "^1.1.1", "get-intrinsic": "^1.1.1", + "get-symbol-description": "^1.0.0", "has": "^1.0.3", "has-symbols": "^1.0.2", - "is-callable": "^1.2.3", + "internal-slot": "^1.0.3", + "is-callable": "^1.2.4", "is-negative-zero": "^2.0.1", - "is-regex": "^1.1.3", - "is-string": "^1.0.6", - "object-inspect": "^1.10.3", + "is-regex": "^1.1.4", + "is-string": "^1.0.7", + "object-inspect": "^1.11.0", "object-keys": "^1.1.1", "object.assign": "^4.1.2", "string.prototype.trimend": "^1.0.4", @@ -6538,28 +6553,33 @@ "integrity": "sha512-9sm5/PxaFG7qNJvJzTROMM1Bk1ozXVTKI0buKOyb0Bsr1hrwi0H/TzxF/COtf1uxikIK8SwhX7K6zg78jAzbeA==" }, "eslint-import-resolver-node": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.4.tgz", - "integrity": "sha512-ogtf+5AB/O+nM6DIeBUNr2fuT7ot9Qg/1harBfBtaP13ekEWFQEEMP94BCB7zaNW3gyY+8SHYF00rnqYwXKWOA==", + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.6.tgz", + "integrity": "sha512-0En0w03NRVMn9Uiyn8YRPDKvWjxCWkslUEhGNTdGx15RvPJYQ+lbOlqrlNI2vEAs4pDYK4f/HN2TbDmk5TP0iw==", "requires": { - "debug": "^2.6.9", - "resolve": "^1.13.1" + "debug": "^3.2.7", + "resolve": "^1.20.0" }, "dependencies": { "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } + }, + "ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" } } }, "eslint-module-utils": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.1.tgz", - "integrity": "sha512-ZXI9B8cxAJIH4nfkhTwcRTEAnrVfobYqwjWy/QMCZ8rHkZHFjf9yO4BzpiF9kCSfNlMG54eKigISHpX0+AaT4A==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.6.2.tgz", + "integrity": "sha512-QG8pcgThYOuqxupd06oYTZoNOGaUdTY1PqK+oS6ElF6vs4pBdk/aYxFVQQXzcrAqp9m7cl7lb2ubazX+g16k2Q==", "requires": { "debug": "^3.2.7", "pkg-dir": "^2.0.0" @@ -7155,11 +7175,11 @@ } }, "ext": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.4.0.tgz", - "integrity": "sha512-Key5NIsUxdqKg3vIsdw9dSuXpPCQ297y6wBjL30edxwPgt2E44WcWBZey/ZvUc6sERLTxKdyCu4gZFmUbk1Q7A==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/ext/-/ext-1.5.0.tgz", + "integrity": "sha512-+ONcYoWj/SoQwUofMr94aGu05Ou4FepKi7N7b+O8T4jVfyIsZQV1/xeS8jpaBzF0csAk0KLXoHCxU7cKYZjo1Q==", "requires": { - "type": "^2.0.0" + "type": "^2.5.0" }, "dependencies": { "type": { @@ -7273,6 +7293,14 @@ "webpack-sources": "^1.1.0" }, "dependencies": { + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, "loader-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", @@ -7358,9 +7386,9 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=" }, "fast-safe-stringify": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.0.8.tgz", - "integrity": "sha512-lXatBjf3WPjmWD6DpIZxkeSsCOwqI0maYMpgDlx8g4U2qi4lbjA9oH/HD2a87G+KfsUmo5WbJFmqBZlPxtptag==" + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" }, "fastest-levenshtein": { "version": "1.0.12", @@ -7368,9 +7396,9 @@ "integrity": "sha512-On2N+BpYJ15xIC974QNVuYGMOlEVt4s0EOI3wwMqOmK1fdDY+FN/zltPV8vosq4ad4c/gJ1KHScUn/6AWIgiow==" }, "fastq": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.11.1.tgz", - "integrity": "sha512-HOnr8Mc60eNYl1gzwp6r5RoUyAn5/glBolUzP/Ez6IFVPMPirxn/9phgL6zhOtaTy7ISwPvQ+wT+hfcRZh/bzw==", + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.13.0.tgz", + "integrity": "sha512-YpkpUnK8od0o1hmeSc7UUs/eB/vIPWJYjKck2QKIzAf71Vm1AAQ3EbuZB3g2JIy+pg+ERD0vqI79KyZiB2e2Nw==", "requires": { "reusify": "^1.0.4" } @@ -7454,9 +7482,9 @@ } }, "find-cache-dir": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.2.tgz", + "integrity": "sha512-wXZV5emFEjrridIgED11OoUKLxiYjAcqot/NJdAkOhlJ+vGzwhOAfcG5OX1jP+S0PcjEn8bdMJv+g2jwQ3Onig==", "requires": { "commondir": "^1.0.1", "make-dir": "^3.0.2", @@ -7497,9 +7525,9 @@ } }, "flatted": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.1.tgz", - "integrity": "sha512-OMQjaErSFHmHqZe+PSidH5n8j3O0F2DdnVh8JB4j4eUQ2k6KvB0qGfrKIhapvez5JerBbmWkaLYUYWISaESoXg==" + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.2.tgz", + "integrity": "sha512-JaTY/wtrcSyvXJl4IMFHPKyFur1sE9AUqc0QnhOaJ0CxHtAoIV8pYDzeEfAaNEtGkOfq4gr3LBFmdXW5mOQFnA==" }, "flatten": { "version": "1.0.3", @@ -7540,9 +7568,9 @@ } }, "follow-redirects": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.1.tgz", - "integrity": "sha512-HWqDgT7ZEkqRzBvc2s64vSZ/hfOceEol3ac/7tKwzuvEyWx3/4UegXh5oBOIotkGsObyk3xznnSRVADBgWSQVg==" + "version": "1.14.4", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.4.tgz", + "integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==" }, "for-in": { "version": "1.0.2", @@ -7731,47 +7759,40 @@ "dependencies": { "ansi-regex": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==" + "bundled": true }, "ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "bundled": true, "requires": { "color-convert": "^1.9.0" } }, "bindings": { "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "bundled": true, "requires": { "file-uri-to-path": "1.0.0" } }, "bip66": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/bip66/-/bip66-1.1.5.tgz", - "integrity": "sha1-AfqHSHhcpwlV1QESF9GzE5lpyiI=", + "bundled": true, "requires": { "safe-buffer": "^5.0.1" } }, "bn.js": { "version": "4.11.8", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.11.8.tgz", - "integrity": "sha512-ItfYfPLkWHUjckQCk8xC+LwxgK8NYcXywGigJgSwOP8Y2iyWT4f2vsZnoOXTTbo+o5yXmIUJ4gn5538SO5S3gA==" + "bundled": true }, "brorand": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha1-EsJe/kCkXjwyPrhnWgoM5XsiNx8=" + "bundled": true }, "browserify-aes": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", + "bundled": true, "requires": { "buffer-xor": "^1.0.3", "cipher-base": "^1.0.0", @@ -7783,23 +7804,19 @@ }, "buffer-from": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "bundled": true }, "buffer-xor": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha1-JuYe0UIvtw3ULm42cp7VHYVf6Nk=" + "bundled": true }, "camelcase": { "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "bundled": true }, "cipher-base": { "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", + "bundled": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -7807,8 +7824,7 @@ }, "cliui": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-5.0.0.tgz", - "integrity": "sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==", + "bundled": true, "requires": { "string-width": "^3.1.0", "strip-ansi": "^5.2.0", @@ -7817,21 +7833,18 @@ }, "color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "bundled": true, "requires": { "color-name": "1.1.3" } }, "color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + "bundled": true }, "create-hash": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", + "bundled": true, "requires": { "cipher-base": "^1.0.1", "inherits": "^2.0.1", @@ -7842,8 +7855,7 @@ }, "create-hmac": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", + "bundled": true, "requires": { "cipher-base": "^1.0.3", "create-hash": "^1.1.0", @@ -7855,8 +7867,7 @@ }, "cross-spawn": { "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "bundled": true, "requires": { "nice-try": "^1.0.4", "path-key": "^2.0.1", @@ -7867,13 +7878,11 @@ }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "bundled": true }, "drbg.js": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/drbg.js/-/drbg.js-1.0.1.tgz", - "integrity": "sha1-Pja2xCs3BDgjzbwzLVjzHiRFSAs=", + "bundled": true, "requires": { "browserify-aes": "^1.0.6", "create-hash": "^1.1.2", @@ -7882,8 +7891,7 @@ }, "elliptic": { "version": "6.5.0", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.0.tgz", - "integrity": "sha512-eFOJTMyCYb7xtE/caJ6JJu+bhi67WCYNbkGSknu20pmM8Ke/bqOfdnZWxyoGN26JgfxTbXrsCkEw4KheCT/KGg==", + "bundled": true, "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", @@ -7896,21 +7904,18 @@ }, "emoji-regex": { "version": "7.0.3", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==" + "bundled": true }, "end-of-stream": { "version": "1.4.1", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz", - "integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==", + "bundled": true, "requires": { "once": "^1.4.0" } }, "ethereumjs-util": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-6.1.0.tgz", - "integrity": "sha512-URESKMFbDeJxnAxPppnk2fN6Y3BIatn9fwn76Lm8bQlt+s52TpG8dN9M66MLPuRAiAOIqL3dfwqWJf0sd0fL0Q==", + "bundled": true, "requires": { "bn.js": "^4.11.0", "create-hash": "^1.1.2", @@ -7923,8 +7928,7 @@ }, "ethjs-util": { "version": "0.1.6", - "resolved": "https://registry.npmjs.org/ethjs-util/-/ethjs-util-0.1.6.tgz", - "integrity": "sha512-CUnVOQq7gSpDHZVVrQW8ExxUETWrnrvXYvYz55wOU8Uj4VCgw56XC2B/fVqQN+f7gmrnRHSLVnFAwsCuNwji8w==", + "bundled": true, "requires": { "is-hex-prefixed": "1.0.0", "strip-hex-prefix": "1.0.0" @@ -7932,8 +7936,7 @@ }, "evp_bytestokey": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", + "bundled": true, "requires": { "md5.js": "^1.3.4", "safe-buffer": "^5.1.1" @@ -7941,8 +7944,7 @@ }, "execa": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "bundled": true, "requires": { "cross-spawn": "^6.0.0", "get-stream": "^4.0.0", @@ -7955,34 +7957,29 @@ }, "file-uri-to-path": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==" + "bundled": true }, "find-up": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "bundled": true, "requires": { "locate-path": "^3.0.0" } }, "get-caller-file": { "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" + "bundled": true }, "get-stream": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "bundled": true, "requires": { "pump": "^3.0.0" } }, "hash-base": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.0.4.tgz", - "integrity": "sha1-X8hoaEfs1zSZQDMZprCj8/auSRg=", + "bundled": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -7990,8 +7987,7 @@ }, "hash.js": { "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", + "bundled": true, "requires": { "inherits": "^2.0.3", "minimalistic-assert": "^1.0.1" @@ -7999,8 +7995,7 @@ }, "hmac-drbg": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", + "bundled": true, "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", @@ -8009,38 +8004,31 @@ }, "inherits": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + "bundled": true }, "invert-kv": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", - "integrity": "sha512-wPVv/y/QQ/Uiirj/vh3oP+1Ww+AWehmi1g5fFWGPF6IpCBCDVrhgHRMvrLfdYcwDh3QJbGXDW4JAuzxElLSqKA==" + "bundled": true }, "is-fullwidth-code-point": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", - "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=" + "bundled": true }, "is-hex-prefixed": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-hex-prefixed/-/is-hex-prefixed-1.0.0.tgz", - "integrity": "sha1-fY035q135dEnFIkTxXPggtd39VQ=" + "bundled": true }, "is-stream": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=" + "bundled": true }, "isexe": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" + "bundled": true }, "keccak": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-1.4.0.tgz", - "integrity": "sha512-eZVaCpblK5formjPjeTBik7TAg+pqnDrMHIffSvi9Lh7PQgM1+hSzakUeZFCk9DVVG0dacZJuaz2ntwlzZUIBw==", + "bundled": true, "requires": { "bindings": "^1.2.1", "inherits": "^2.0.3", @@ -8050,16 +8038,14 @@ }, "lcid": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", - "integrity": "sha512-avPEb8P8EGnwXKClwsNUgryVjllcRqtMYa49NTsbQagYuT1DcXnl1915oxWjoyGrXR6zH/Y0Zc96xWsPcoDKeA==", + "bundled": true, "requires": { "invert-kv": "^2.0.0" } }, "locate-path": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "bundled": true, "requires": { "p-locate": "^3.0.0", "path-exists": "^3.0.0" @@ -8067,16 +8053,14 @@ }, "map-age-cleaner": { "version": "0.1.3", - "resolved": "https://registry.npmjs.org/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz", - "integrity": "sha512-bJzx6nMoP6PDLPBFmg7+xRKeFZvFboMrGlxmNj9ClvX53KrmvM5bXFXEWjbz4cz1AFn+jWJ9z/DJSz7hrs0w3w==", + "bundled": true, "requires": { "p-defer": "^1.0.0" } }, "md5.js": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", + "bundled": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1", @@ -8085,8 +8069,7 @@ }, "mem": { "version": "4.3.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", - "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", + "bundled": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^2.0.0", @@ -8095,49 +8078,41 @@ }, "mimic-fn": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", - "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + "bundled": true }, "minimalistic-assert": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" + "bundled": true }, "minimalistic-crypto-utils": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" + "bundled": true }, "nan": { "version": "2.14.0", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", - "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==" + "bundled": true }, "nice-try": { "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" + "bundled": true }, "npm-run-path": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "bundled": true, "requires": { "path-key": "^2.0.0" } }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "requires": { "wrappy": "1" } }, "os-locale": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-locale/-/os-locale-3.1.0.tgz", - "integrity": "sha512-Z8l3R4wYWM40/52Z+S265okfFj8Kt2cC2MKY+xNi3kFs+XGI7WXu/I309QQQYbRW4ijiZ+yxs9pqEhJh0DqW3Q==", + "bundled": true, "requires": { "execa": "^1.0.0", "lcid": "^2.0.0", @@ -8146,54 +8121,45 @@ }, "p-defer": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-defer/-/p-defer-1.0.0.tgz", - "integrity": "sha1-n26xgvbJqozXQwBKfU+WsZaw+ww=" + "bundled": true }, "p-finally": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=" + "bundled": true }, "p-is-promise": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", - "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==" + "bundled": true }, "p-limit": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", - "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", + "bundled": true, "requires": { "p-try": "^2.0.0" } }, "p-locate": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "bundled": true, "requires": { "p-limit": "^2.0.0" } }, "p-try": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" + "bundled": true }, "path-exists": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" + "bundled": true }, "path-key": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=" + "bundled": true }, "pump": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "bundled": true, "requires": { "end-of-stream": "^1.1.0", "once": "^1.3.1" @@ -8201,18 +8167,15 @@ }, "require-directory": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" + "bundled": true }, "require-main-filename": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + "bundled": true }, "ripemd160": { "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", + "bundled": true, "requires": { "hash-base": "^3.0.0", "inherits": "^2.0.1" @@ -8220,8 +8183,7 @@ }, "rlp": { "version": "2.2.3", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.3.tgz", - "integrity": "sha512-l6YVrI7+d2vpW6D6rS05x2Xrmq8oW7v3pieZOJKBEdjuTF4Kz/iwk55Zyh1Zaz+KOB2kC8+2jZlp2u9L4tTzCQ==", + "bundled": true, "requires": { "bn.js": "^4.11.1", "safe-buffer": "^5.1.1" @@ -8229,13 +8191,11 @@ }, "safe-buffer": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.0.tgz", - "integrity": "sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==" + "bundled": true }, "secp256k1": { "version": "3.7.1", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-3.7.1.tgz", - "integrity": "sha512-1cf8sbnRreXrQFdH6qsg2H71Xw91fCCS9Yp021GnUNJzWJS/py96fS4lHbnTnouLp08Xj6jBoBB6V78Tdbdu5g==", + "bundled": true, "requires": { "bindings": "^1.5.0", "bip66": "^1.1.5", @@ -8249,18 +8209,15 @@ }, "semver": { "version": "5.7.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", - "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==" + "bundled": true }, "set-blocking": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" + "bundled": true }, "sha.js": { "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", + "bundled": true, "requires": { "inherits": "^2.0.1", "safe-buffer": "^5.0.1" @@ -8268,31 +8225,26 @@ }, "shebang-command": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "bundled": true, "requires": { "shebang-regex": "^1.0.0" } }, "shebang-regex": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=" + "bundled": true }, "signal-exit": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", - "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=" + "bundled": true }, "source-map": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + "bundled": true }, "source-map-support": { "version": "0.5.12", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", - "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", + "bundled": true, "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -8300,8 +8252,7 @@ }, "string-width": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "bundled": true, "requires": { "emoji-regex": "^7.0.1", "is-fullwidth-code-point": "^2.0.0", @@ -8310,42 +8261,36 @@ }, "strip-ansi": { "version": "5.2.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "bundled": true, "requires": { "ansi-regex": "^4.1.0" } }, "strip-eof": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=" + "bundled": true }, "strip-hex-prefix": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-hex-prefix/-/strip-hex-prefix-1.0.0.tgz", - "integrity": "sha1-DF8VX+8RUTczd96du1iNoFUA428=", + "bundled": true, "requires": { "is-hex-prefixed": "1.0.0" } }, "which": { "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "bundled": true, "requires": { "isexe": "^2.0.0" } }, "which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + "bundled": true }, "wrap-ansi": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-5.1.0.tgz", - "integrity": "sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==", + "bundled": true, "requires": { "ansi-styles": "^3.2.0", "string-width": "^3.0.0", @@ -8354,18 +8299,15 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "bundled": true }, "y18n": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==" + "bundled": true }, "yargs": { "version": "13.2.4", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.4.tgz", - "integrity": "sha512-HG/DWAJa1PAnHT9JAhNa8AbAv3FPaiLzioSjCcmuXXhP8MlpHO5vwls4g4j6n30Z74GVQj8Xa62dWVx1QCGklg==", + "bundled": true, "requires": { "cliui": "^5.0.0", "find-up": "^3.0.0", @@ -8382,8 +8324,7 @@ }, "yargs-parser": { "version": "13.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-13.1.1.tgz", - "integrity": "sha512-oVAVsHz6uFrg3XQheFII8ESO2ssAf9luWuAd6Wexsu4F3OtIW0o8IribPXYrD4WC24LWtPrJlGy87y5udK+dxQ==", + "bundled": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -16403,6 +16344,15 @@ "pump": "^3.0.0" } }, + "get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", + "requires": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" + } + }, "get-value": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", @@ -16431,9 +16381,9 @@ } }, "git-url-parse": { - "version": "11.5.0", - "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.5.0.tgz", - "integrity": "sha512-TZYSMDeM37r71Lqg1mbnMlOqlHd7BSij9qN7XwTkRqSAYFMihGLGhfHwgqQob3GUhEneKnV4nskN9rbQw2KGxA==", + "version": "11.6.0", + "resolved": "https://registry.npmjs.org/git-url-parse/-/git-url-parse-11.6.0.tgz", + "integrity": "sha512-WWUxvJs5HsyHL6L08wOusa/IXYtMuCAhrMmnTjQPpBU0TTHyDhnOATNH3xNQz7YOQUsqIIPTGr4xiVti1Hsk5g==", "requires": { "git-up": "^4.0.0" } @@ -16520,9 +16470,9 @@ } }, "graceful-fs": { - "version": "4.2.6", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.6.tgz", - "integrity": "sha512-nTnJ528pbqxYanhpDYsi4Rd8MAeaBA67+RZ10CM1m3bTAVFEDcd5AuA4a6W5YkGZ1iNXHzZz8T6TBKLeBuNriQ==" + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.8.tgz", + "integrity": "sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg==" }, "gzip-size": { "version": "5.1.1", @@ -16768,6 +16718,14 @@ "has-symbol-support-x": "^1.4.1" } }, + "has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "requires": { + "has-symbols": "^1.0.2" + } + }, "has-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", @@ -16903,9 +16861,9 @@ "integrity": "sha1-wc56MWjIxmFAM6S194d/OyJfnDg=" }, "html-entities": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-1.4.0.tgz", - "integrity": "sha512-8nxjcBcd8wovbeKx7h3wTji4e6+rhaVuPNpMqwWgnHh+N9ToqsCs6XztWRBPQ+UtzsoMAdKZtUENoVzU/EMtZA==" + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/html-entities/-/html-entities-2.3.2.tgz", + "integrity": "sha512-c3Ab/url5ksaT0WyleslpBEthOzWhrjQbg75y7XUsfSzi3Dgzt0l8w5e7DylRn15MTlMMD58dTfzddNS2kcAjQ==" }, "html-escaper": { "version": "2.0.2", @@ -17036,9 +16994,9 @@ "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" }, "domutils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", - "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", "requires": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", @@ -17257,6 +17215,16 @@ "through": "^2.3.6" } }, + "internal-slot": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.3.tgz", + "integrity": "sha512-O0DB1JC/sPyZl7cIo78n5dR7eUSwwpYPiXRhTzNxZVAMUuB8vlnRFyLxdrVToks6XPLVnFfbzaVd5WLjhgg+vA==", + "requires": { + "get-intrinsic": "^1.1.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" + } + }, "interpret": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-2.2.0.tgz", @@ -17296,11 +17264,12 @@ } }, "is-arguments": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.0.tgz", - "integrity": "sha512-1Ij4lOMPl/xB5kBDn7I+b2ttPMKa8szhEIrXDuXQD/oe3HJLTLhqhgGspwgyGd6MOywBUqVvYicF72lkgDnIHg==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", + "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", "requires": { - "call-bind": "^1.0.0" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, "is-arrayish": { @@ -17309,9 +17278,12 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-bigint": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.2.tgz", - "integrity": "sha512-0JV5+SOCQkIdzjBK9buARcV804Ddu7A0Qet6sHi3FimE9ne6m4BGQZfRn+NZiXbBk4F4XmHfDZIipLj9pX8dSA==" + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "requires": { + "has-bigints": "^1.0.1" + } }, "is-binary-path": { "version": "2.1.0", @@ -17322,11 +17294,12 @@ } }, "is-boolean-object": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.1.tgz", - "integrity": "sha512-bXdQWkECBUIAcCkeH1unwJLIpZYaa5VvuygSyS/c2lf719mTKZDU5UdDRlpd01UjADgmW8RfqaP+mRaVPdr/Ng==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", "requires": { - "call-bind": "^1.0.2" + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" } }, "is-buffer": { @@ -17335,9 +17308,9 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==" }, "is-callable": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", - "integrity": "sha512-J1DcMe8UYTBSrKezuIUTUwjXsho29693unXM2YhJUTR2txK/eG47bvNa/wipPFmZFgr/N6f1GA66dv0mEyTIyQ==" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.4.tgz", + "integrity": "sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==" }, "is-color-stop": { "version": "1.1.0", @@ -17353,9 +17326,9 @@ } }, "is-core-module": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.5.0.tgz", - "integrity": "sha512-TXCMSDsEHMEEZ6eCA8rwRDbLu55MRGmrctljsBX/2v1d9/GzqHOxW5c5oPSgrUt2vBFXebu9rGqckXGPWOlYpg==", + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.6.0.tgz", + "integrity": "sha512-wShG8vs60jKfPWpF2KZRaAtvt3a20OAn7+IJ6hLPECpSABLcKtFKTTI4ZtH5QcBruBHlq+WsdHWyz0BCZW7svQ==", "requires": { "has": "^1.0.3" } @@ -17379,9 +17352,12 @@ } }, "is-date-object": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.4.tgz", - "integrity": "sha512-/b4ZVsG7Z5XVtIxs/h9W8nvfLgSAyKYdtGWQLbqy6jA1icmgjf8WCoTKgeS4wy5tYaPePouzFMANbnj94c2Z+A==" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-descriptor": { "version": "0.1.6", @@ -17431,9 +17407,12 @@ "integrity": "sha512-lw7DUp0aWXYg+CBCN+JKkcE0Q2RayZnSvnZBlwgxHBQhqt5pZNVy4Ri7H9GmmXkdu7LUthszM+Tor1u/2iBcpQ==" }, "is-generator-function": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.9.tgz", - "integrity": "sha512-ZJ34p1uvIfptHCN7sFTjGibB9/oBg17sHqzDLfuwhvmN/qLVvIQXRQ8licZQ35WJ8KuEQt/etnnzQFI9C9Ue/A==" + "version": "1.0.10", + "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", + "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-glob": { "version": "4.0.1", @@ -17459,9 +17438,12 @@ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==" }, "is-number-object": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.5.tgz", - "integrity": "sha512-RU0lI/n95pMoUKu9v1BZP5MBcZuNSVJkMkAG2dJqC4z2GlkGUNeH68SuHuBKBD/XFe+LHZ+f9BKkLET60Niedw==" + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.6.tgz", + "integrity": "sha512-bEVOqiRcvo3zO1+G2lVMy+gkkEm9Yh7cDMRusKKu5ZJKPUYSJwICTKZrNKHA2EbSP0Tu0+6B/emsYNHZyn6K8g==", + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-obj": { "version": "2.0.0", @@ -17492,12 +17474,12 @@ "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ==" }, "is-regex": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.3.tgz", - "integrity": "sha512-qSVXFz28HM7y+IWX6vLCsexdlvzT1PJNFSBuaQLQ5o0IEw8UDYW6/2+eCMVyIsbM8CNLX2a/QWmSpyxYEHY7CQ==", + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "requires": { "call-bind": "^1.0.2", - "has-symbols": "^1.0.2" + "has-tostringtag": "^1.0.0" } }, "is-resolvable": { @@ -17524,9 +17506,12 @@ "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" }, "is-string": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.6.tgz", - "integrity": "sha512-2gdzbKUuqtQ3lYNrUTQYoClPhm7oQu4UdpSZMp1/DGgkHBT8E2Z1l0yMdb6D4zNAxwDiMv8MdulKROJGNl0Q0w==" + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", + "requires": { + "has-tostringtag": "^1.0.0" + } }, "is-symbol": { "version": "1.0.4", @@ -17537,15 +17522,15 @@ } }, "is-typed-array": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.5.tgz", - "integrity": "sha512-S+GRDgJlR3PyEbsX/Fobd9cqpZBuvUS+8asRqYDMLCb2qMzt1oz5m5oxQCxOgUDxiWsOVNi4yaF+/uvdlHlYug==", + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.8.tgz", + "integrity": "sha512-HqH41TNZq2fgtGT8WHVFVJhBVGuY3AnP3Q36K8JKXUxSxRgk/d+7NjmwG2vo2mYmXK8UYZKu0qH8bVP5gEisjA==", "requires": { - "available-typed-arrays": "^1.0.2", + "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", - "es-abstract": "^1.18.0-next.2", + "es-abstract": "^1.18.5", "foreach": "^2.0.5", - "has-symbols": "^1.0.1" + "has-tostringtag": "^1.0.0" } }, "is-typedarray": { @@ -17770,11 +17755,11 @@ "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=" }, "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "requires": { - "minimist": "^1.2.5" + "minimist": "^1.2.0" } }, "jsonfile": { @@ -17803,12 +17788,13 @@ } }, "keccak": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.1.tgz", - "integrity": "sha512-epq90L9jlFWCW7+pQa6JOnKn2Xgl2mtI664seYR6MHskvI9agt7AnDqmAlp9TqU4/caMYbA08Hi5DMZAl5zdkA==", + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.2.tgz", + "integrity": "sha512-PyKKjkH53wDMLGrvmRGSNWgmSxZOUqbnXwKL9tmgbFYA1iAYqW21kfR7mZXV0MlESiefxQQE9X9fTa3X+2MPDQ==", "requires": { "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0" + "node-gyp-build": "^4.2.0", + "readable-stream": "^3.6.0" } }, "keyv": { @@ -17942,16 +17928,6 @@ "big.js": "^5.2.2", "emojis-list": "^3.0.0", "json5": "^1.0.1" - }, - "dependencies": { - "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", - "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", - "requires": { - "minimist": "^1.2.0" - } - } } }, "locate-path": { @@ -18043,9 +18019,9 @@ }, "dependencies": { "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } }, @@ -18320,9 +18296,9 @@ }, "dependencies": { "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" } @@ -18338,9 +18314,9 @@ }, "dependencies": { "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" } @@ -18356,9 +18332,9 @@ }, "dependencies": { "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" } @@ -18517,9 +18493,9 @@ "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" }, "nan": { - "version": "2.14.2", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.2.tgz", - "integrity": "sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==", + "version": "2.15.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.15.0.tgz", + "integrity": "sha512-8ZtvEnA2c5aYCZYd1cvgdnU6cqwixRoYg70xPLWUws5ORTa/lnw+u4amixRS/Ac5U5mQVgp9pnlSUnbNWFaWZQ==", "optional": true }, "nano-json-stream-parser": { @@ -18528,9 +18504,9 @@ "integrity": "sha1-DMj20OK2IrR5xA1JnEbWS3Vcb18=" }, "nanoid": { - "version": "3.1.23", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.23.tgz", - "integrity": "sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==" + "version": "3.1.25", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.1.25.tgz", + "integrity": "sha512-rdwtIXaXCLFAQbnfqDRnI6jaRHp9fTcYBjtFKE8eezcZ7LuLjhUaQGNeMXf1HmRoCH32CLz6XwX0TtxEOS/A3Q==" }, "nanomatch": { "version": "1.2.13", @@ -18585,9 +18561,9 @@ }, "dependencies": { "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } }, @@ -18602,9 +18578,9 @@ "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" }, "node-gyp-build": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.2.3.tgz", - "integrity": "sha512-MN6ZpzmfNCRM+3t57PTJHgHyw/h4OWnZ6mR8P5j/uZtqQr46RRuDE/P+g3n0YR/AiYXeWixZZzaip77gdICfRg==" + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.3.0.tgz", + "integrity": "sha512-iWjXZvmboq0ja1pUGULQBexmxq8CV4xBhX7VDOTbL7ZR4FOowwY/VOtRxBN/yKxmdGoIp4j5ysNT4u3S2pDQ3Q==" }, "node-html-parser": { "version": "1.4.9", @@ -18714,9 +18690,9 @@ } }, "node-releases": { - "version": "1.1.73", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.73.tgz", - "integrity": "sha512-uW7fodD6pyW2FZNZnp/Z3hvWKeEW1Y8R1+1CnErE8cXFXzl5blBOoVB41CvMer6P6Q0S5FXDwcHgFd1Wj0U9zg==" + "version": "1.1.75", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.75.tgz", + "integrity": "sha512-Qe5OUajvqrqDSy6wrWFmMwfJ0jVgwiw4T3KqmbTcZ62qW0gQkheXYhcFM1+lOVcGUoRxcEcfyvFMAnDgaF1VWw==" }, "node-res": { "version": "5.0.1", @@ -19134,9 +19110,9 @@ }, "dependencies": { "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } }, @@ -19170,9 +19146,9 @@ } }, "parse-headers": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.3.tgz", - "integrity": "sha512-QhhZ+DCCit2Coi2vmAKbq5RGTRcQUOE2+REgv8vdyu7MnYx2eZztegqtTx99TZ86GTIwqiy3+4nQTWZ2tgmdCA==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/parse-headers/-/parse-headers-2.0.4.tgz", + "integrity": "sha512-psZ9iZoCNFLrgRjZ1d8mn0h9WRqJwFxM9q3x7iUjN/YT2OksthDJ5TiPCu2F38kS4zutqfW+YdVVkBZZx3/1aw==" }, "parse-json": { "version": "2.2.0", @@ -19252,9 +19228,9 @@ }, "dependencies": { "tslib": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.0.tgz", - "integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg==" + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==" } } }, @@ -20731,11 +20707,11 @@ "integrity": "sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A==" }, "regenerate-unicode-properties": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-9.0.0.tgz", + "integrity": "sha512-3E12UeNSPfjrgwjkR81m5J7Aw/T55Tu7nUyZVQYCKEOs+2dkxEY+DpPtZzO4YruuiPb7NkYLVcyJC4+zCbk5pA==", "requires": { - "regenerate": "^1.4.0" + "regenerate": "^1.4.2" } }, "regenerator-runtime": { @@ -20781,16 +20757,16 @@ "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==" }, "regexpu-core": { - "version": "4.7.1", - "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.1.tgz", - "integrity": "sha512-ywH2VUraA44DZQuRKzARmw6S66mr48pQVva4LBeRhcOltJ6hExvWly5ZjFLYo67xbIxb6W1q4bAGtgfEl20zfQ==", + "version": "4.8.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.8.0.tgz", + "integrity": "sha512-1F6bYsoYiz6is+oz70NWur2Vlh9KWtswuRuzJOfeYUrfPX2o8n74AnUVaOGDbUqVGO9fNHu48/pjJO4sNVwsOg==", "requires": { - "regenerate": "^1.4.0", - "regenerate-unicode-properties": "^8.2.0", - "regjsgen": "^0.5.1", - "regjsparser": "^0.6.4", - "unicode-match-property-ecmascript": "^1.0.4", - "unicode-match-property-value-ecmascript": "^1.2.0" + "regenerate": "^1.4.2", + "regenerate-unicode-properties": "^9.0.0", + "regjsgen": "^0.5.2", + "regjsparser": "^0.7.0", + "unicode-match-property-ecmascript": "^2.0.0", + "unicode-match-property-value-ecmascript": "^2.0.0" } }, "regextras": { @@ -20804,9 +20780,9 @@ "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==" }, "regjsparser": { - "version": "0.6.9", - "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.9.tgz", - "integrity": "sha512-ZqbNRz1SNjLAiYuwY0zoXW8Ne675IX5q+YHioAGbCw4X96Mjl2+dcX9B2ciaeyYjViDAfvIjFpQjJgLttTEERQ==", + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.7.0.tgz", + "integrity": "sha512-A4pcaORqmNMDVwUjWoTzuhwMGpP+NykpfqAsEgI1FSH/EzC7lrN5TMd+kN8YCovX+jMpu8eaqXgXPCa0g8FQNQ==", "requires": { "jsesc": "~0.5.0" }, @@ -20887,9 +20863,9 @@ "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" }, "domutils": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.7.0.tgz", - "integrity": "sha512-8eaHa17IwJUPAiB+SoTYBo5mCdeMgdcAoXJ59m6DT1vw+5iLS3gNoqYaRowaBKtGVrOF1Jz4yDTgYKLK2kvfJg==", + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", + "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", "requires": { "dom-serializer": "^1.0.1", "domelementtype": "^2.2.0", @@ -21331,9 +21307,9 @@ } }, "signal-exit": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "simple-concat": { "version": "1.0.1", @@ -22112,9 +22088,9 @@ } }, "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "version": "0.5.20", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.20.tgz", + "integrity": "sha512-n1lZZ8Ve4ksRqizaBQgxXDgKwttHDhyfQjA6YZZn8+AroHbsIz+JjwxQDxbp+7y5OYCI8t1Yk7etjD9CRd2hIw==", "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -22169,9 +22145,9 @@ } }, "spdx-license-ids": { - "version": "3.0.9", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.9.tgz", - "integrity": "sha512-Ki212dKK4ogX+xDo4CtOZBVIwhsKBEfsEEcwmJfLQzirgc2jIWdzg40Unxz/HzEUqM1WFzVlQSMF9kZZ2HboLQ==" + "version": "3.0.10", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz", + "integrity": "sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==" }, "split-on-first": { "version": "1.1.0", @@ -22217,9 +22193,9 @@ }, "dependencies": { "minipass": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.3.tgz", - "integrity": "sha512-Mgd2GdMVzY+x3IJ+oHnVM+KG3lA5c8tnabyJKmHSaG2kAGpudxuOf8ToDkhumF7UzME7DecbQE9uOZhNm7PuJg==", + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.5.tgz", + "integrity": "sha512-+8NzxD82XQoNKNrl1d/FSi+X8wAEWR+sbYAfIvub4Nz0d22plFG72CEVVaufV8PNf4qSslFTD8VMOxNVhHCjTw==", "requires": { "yallist": "^4.0.0" } @@ -22452,6 +22428,14 @@ "schema-utils": "^3.0.0" }, "dependencies": { + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "requires": { + "minimist": "^1.2.5" + } + }, "loader-utils": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-2.0.0.tgz", @@ -22767,9 +22751,9 @@ }, "dependencies": { "ajv": { - "version": "8.6.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.2.tgz", - "integrity": "sha512-9807RlWAgT564wT+DjeyU5OFMPjmzxVobvDFmNAhY+5zD6A2ly3jDp6sgnfyDtlIQ+7H97oc/DGCzzfu9rjw9w==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.6.3.tgz", + "integrity": "sha512-SMJOdDP6LqTkD0Uq8qLi+gMwSt0imXLSV080qFVwJCpH9U6Mb+SUGHAXM0KNbcBPguytWyvFxcHgMLe2D2XSpw==", "requires": { "fast-deep-equal": "^3.1.1", "json-schema-traverse": "^1.0.0", @@ -22790,17 +22774,17 @@ "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" }, "tar": { - "version": "4.4.15", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.15.tgz", - "integrity": "sha512-ItbufpujXkry7bHH9NpQyTXPbJ72iTlXgkBAYsAjDXk3Ds8t/3NfO5P4xZGy7u+sYuQUbimgzswX4uQIEeNVOA==", - "requires": { - "chownr": "^1.1.1", - "fs-minipass": "^1.2.5", - "minipass": "^2.8.6", - "minizlib": "^1.2.1", - "mkdirp": "^0.5.0", - "safe-buffer": "^5.1.2", - "yallist": "^3.0.3" + "version": "4.4.19", + "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.19.tgz", + "integrity": "sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==", + "requires": { + "chownr": "^1.1.4", + "fs-minipass": "^1.2.7", + "minipass": "^2.9.0", + "minizlib": "^1.3.3", + "mkdirp": "^0.5.5", + "safe-buffer": "^5.2.1", + "yallist": "^3.1.1" }, "dependencies": { "mkdirp": { @@ -22811,6 +22795,11 @@ "minimist": "^1.2.5" } }, + "safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + }, "yallist": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", @@ -23074,11 +23063,12 @@ } }, "tsconfig-paths": { - "version": "3.10.1", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.10.1.tgz", - "integrity": "sha512-rETidPDgCpltxF7MjBZlAFPUHv5aHH2MymyPvh+vEyWAED4Eb/WeMbsnD/JDr4OKPOA1TssDHgIcpTN5Kh0p6Q==", + "version": "3.11.0", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.11.0.tgz", + "integrity": "sha512-7ecdYDnIdmv639mmDwslG6KQg1Z9STTz1j7Gcz0xa+nshh/gKDAHcPxRbWOsA3SPp0tXP2leTcY9Kw+NAkfZzA==", "requires": { - "json5": "^2.2.0", + "@types/json5": "^0.0.29", + "json5": "^1.0.1", "minimist": "^1.2.0", "strip-bom": "^3.0.0" } @@ -23165,9 +23155,9 @@ "integrity": "sha512-6Gurc1n//gjp9eQNXjD9O3M/sMwVtN5S8Lv9bvOYBfKfDNiIIhqiyi01vMBO45u4zkDE420w/e0se7Vs+sIg+g==" }, "uglify-js": { - "version": "3.14.1", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.1.tgz", - "integrity": "sha512-JhS3hmcVaXlp/xSo3PKY5R0JqKs5M3IV+exdLHW99qKvKivPO4Z8qbej6mte17SOPqAOVMjt/XGgWacnFSzM3g==" + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.14.2.tgz", + "integrity": "sha512-rtPMlmcO4agTUfz10CbgJ1k6UAoXM2gWb3GoMPPZB/+/Ackf8lNWk11K4rYi2D0apgoFRLtQOZhb+/iGNJq26A==" }, "ultron": { "version": "1.1.1", @@ -23196,28 +23186,28 @@ "integrity": "sha512-F9p7yYCn6cIW9El1zi0HI6vqpeIvBsr3dSuRO6Xuppb1u5rXpCPmMvLSyECLhybr9isec8Ohl0hPekMVrEinDA==" }, "unicode-canonical-property-names-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz", + "integrity": "sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ==" }, "unicode-match-property-ecmascript": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz", + "integrity": "sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q==", "requires": { - "unicode-canonical-property-names-ecmascript": "^1.0.4", - "unicode-property-aliases-ecmascript": "^1.0.4" + "unicode-canonical-property-names-ecmascript": "^2.0.0", + "unicode-property-aliases-ecmascript": "^2.0.0" } }, "unicode-match-property-value-ecmascript": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.0.0.tgz", + "integrity": "sha512-7Yhkc0Ye+t4PNYzOGKedDhXbYIBe1XEQYQxOPyhcXNMJ0WCABqqj6ckydd6pWRZTHV4GuCPKdBAUiMc60tsKVw==" }, "unicode-property-aliases-ecmascript": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==" + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.0.0.tgz", + "integrity": "sha512-5Zfuy9q/DFr4tfO7ZPeVXb1aPoeQSdeFMLpYuFebehDAhbuevLs5yxSZmIFN1tP5F9Wl4IpJrYojg85/zgyZHQ==" }, "union-value": { "version": "1.0.1", @@ -23503,9 +23493,9 @@ "integrity": "sha512-BXq3jwIagosjgNVae6tkHzzIk6a8MHFtzAdwhnV5VlvPTFxDCvIttgSiHWjdGoTJvXtmRu5HacExfdarRcFhog==" }, "vue-loader": { - "version": "15.9.6", - "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.6.tgz", - "integrity": "sha512-j0cqiLzwbeImIC6nVIby2o/ABAWhlppyL/m5oJ67R5MloP0hj/DtFgb0Zmq3J9CG7AJ+AXIvHVnJAPBvrLyuDg==", + "version": "15.9.8", + "resolved": "https://registry.npmjs.org/vue-loader/-/vue-loader-15.9.8.tgz", + "integrity": "sha512-GwSkxPrihfLR69/dSV3+5CdMQ0D+jXg8Ma1S4nQXKJAznYFX14vHdc/NetQc34Dw+rBbIJyP7JOuVb9Fhprvog==", "requires": { "@vue/component-compiler-utils": "^3.1.0", "hash-sum": "^1.0.2", @@ -23923,9 +23913,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.17.tgz", - "integrity": "sha512-so8EHl4S6MmatPS0f9sE1ND94/ocbcEshW5OpyYthRqeRpiYyW2uXYTo/84kmfdfeNrDycARkvuiXl6nO40NGg==" + "version": "12.20.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.25.tgz", + "integrity": "sha512-hcTWqk7DR/HrN9Xe7AlJwuCaL13Vcd9/g/T54YrJz4Q3ESM5mr33YCzW2bOfzSIc3aZMeGBvbLGvgN6mIJ0I5Q==" } } }, @@ -23944,9 +23934,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.17.tgz", - "integrity": "sha512-so8EHl4S6MmatPS0f9sE1ND94/ocbcEshW5OpyYthRqeRpiYyW2uXYTo/84kmfdfeNrDycARkvuiXl6nO40NGg==" + "version": "12.20.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.25.tgz", + "integrity": "sha512-hcTWqk7DR/HrN9Xe7AlJwuCaL13Vcd9/g/T54YrJz4Q3ESM5mr33YCzW2bOfzSIc3aZMeGBvbLGvgN6mIJ0I5Q==" } } }, @@ -24114,9 +24104,9 @@ }, "dependencies": { "@types/node": { - "version": "12.20.17", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.17.tgz", - "integrity": "sha512-so8EHl4S6MmatPS0f9sE1ND94/ocbcEshW5OpyYthRqeRpiYyW2uXYTo/84kmfdfeNrDycARkvuiXl6nO40NGg==" + "version": "12.20.25", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.25.tgz", + "integrity": "sha512-hcTWqk7DR/HrN9Xe7AlJwuCaL13Vcd9/g/T54YrJz4Q3ESM5mr33YCzW2bOfzSIc3aZMeGBvbLGvgN6mIJ0I5Q==" } } }, @@ -24333,9 +24323,9 @@ } }, "acorn": { - "version": "8.4.1", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.4.1.tgz", - "integrity": "sha512-asabaBSkEKosYKMITunzX177CXxQ4Q8BSSzMTKD+FefUhipQC70gfW5SiUDhYQ3vk8G+81HqQk7Fv9OXwwn9KA==" + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.5.0.tgz", + "integrity": "sha512-yXbYeFy+jUuYd3/CDcg2NkIYE991XYX/bje7LmjJigUciaeO1JR4XxXgCIV1/Zc/dRuFEyw1L0pbA+qynJkW5Q==" }, "commander": { "version": "2.20.3", @@ -24361,9 +24351,9 @@ } }, "jest-worker": { - "version": "27.0.6", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.0.6.tgz", - "integrity": "sha512-qupxcj/dRuA3xHPMUd40gr2EaAurFbkwzOh7wfPaeE9id7hyjURRQoqNfHifHK3XjJU6YJJUQKILGUnwGPEOCA==", + "version": "27.2.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-27.2.0.tgz", + "integrity": "sha512-laB0ZVIBz+voh/QQy9dmUuuDsadixeerrKqyVpgPz+CCWiOYjOBabUXHIXZhsdvkWbLqSHbgkAHWl5cg24Q6RA==", "requires": { "@types/node": "*", "merge-stream": "^2.0.0", @@ -24439,18 +24429,18 @@ } }, "tapable": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.0.tgz", - "integrity": "sha512-FBk4IesMV1rBxX2tfiK8RAmogtWn53puLOQlvO8XuwlgxcYbP4mVPS9Ph4aeamSyyVjOl24aYWAuc8U5kCVwMw==" + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-2.2.1.tgz", + "integrity": "sha512-GNzQvQTOIP6RyTfE2Qxb8ZVlNmw0n88vp1szwWRimP02mnTsx3Wtn5qRdqY9w2XduFNUgvOwhNnQsjwCp+kqaQ==" }, "terser": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.7.1.tgz", - "integrity": "sha512-b3e+d5JbHAe/JSjwsC3Zn55wsBIM7AsHLjKxT31kGCldgbpFePaFo+PiddtO6uwRZWRw7sPXmAN8dTW61xmnSg==", + "version": "5.8.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.8.0.tgz", + "integrity": "sha512-f0JH+6yMpneYcRJN314lZrSwu9eKkUFEHLN/kNy8ceh8gaRiLgFPJqrB9HsXjhEGdv4e/ekjTOFxIlL6xlma8A==", "requires": { "commander": "^2.20.0", "source-map": "~0.7.2", - "source-map-support": "~0.5.19" + "source-map-support": "~0.5.20" }, "dependencies": { "source-map": { @@ -24461,16 +24451,16 @@ } }, "terser-webpack-plugin": { - "version": "5.1.4", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.1.4.tgz", - "integrity": "sha512-C2WkFwstHDhVEmsmlCxrXUtVklS+Ir1A7twrYzrDrQQOIMOaVAYykaoo/Aq1K0QRkMoY2hhvDQY1cm4jnIMFwA==", + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.2.4.tgz", + "integrity": "sha512-E2CkNMN+1cho04YpdANyRrn8CyN4yMy+WdFKZIySFZrGXZxJwJP6PMNGGc/Mcr6qygQHUUqRxnAPmi0M9f00XA==", "requires": { - "jest-worker": "^27.0.2", + "jest-worker": "^27.0.6", "p-limit": "^3.1.0", - "schema-utils": "^3.0.0", + "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", "source-map": "^0.6.1", - "terser": "^5.7.0" + "terser": "^5.7.2" } }, "watchpack": { @@ -24661,29 +24651,14 @@ } }, "webpack-hot-middleware": { - "version": "2.25.0", - "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.25.0.tgz", - "integrity": "sha512-xs5dPOrGPCzuRXNi8F6rwhawWvQQkeli5Ro48PRuQh8pYPCPmNnltP9itiUPT4xI8oW+y0m59lyyeQk54s5VgA==", + "version": "2.25.1", + "resolved": "https://registry.npmjs.org/webpack-hot-middleware/-/webpack-hot-middleware-2.25.1.tgz", + "integrity": "sha512-Koh0KyU/RPYwel/khxbsDz9ibDivmUbrRuKSSQvW42KSDdO4w23WI3SkHpSUKHE76LrFnnM/L7JCrpBwu8AXYw==", "requires": { - "ansi-html": "0.0.7", - "html-entities": "^1.2.0", + "ansi-html-community": "0.0.8", + "html-entities": "^2.1.0", "querystring": "^0.2.0", - "strip-ansi": "^3.0.0" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "requires": { - "ansi-regex": "^2.0.0" - } - } + "strip-ansi": "^6.0.0" } }, "webpack-log": { @@ -24841,17 +24816,16 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" }, "which-typed-array": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.4.tgz", - "integrity": "sha512-49E0SpUe90cjpoc7BOJwyPHRqSAd12c10Qm2amdEZrJPCY2NDxaW01zHITrem+rnETY3dwrbH3UUrUwagfCYDA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.7.tgz", + "integrity": "sha512-vjxaB4nfDqwKI0ws7wZpxIlde1XrLX5uB0ZjpfshgmapJMD7jJWhZI+yToJTqaFByF0eNBcYxbjmCzoRP7CfEw==", "requires": { - "available-typed-arrays": "^1.0.2", - "call-bind": "^1.0.0", - "es-abstract": "^1.18.0-next.1", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-abstract": "^1.18.5", "foreach": "^2.0.5", - "function-bind": "^1.1.1", - "has-symbols": "^1.0.1", - "is-typed-array": "^1.1.3" + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.7" } }, "widest-line": { diff --git a/dist/0xcert-ethereum-asset-ledger.min.js b/dist/0xcert-ethereum-asset-ledger.min.js index 446ba5415..be30ada56 100644 --- a/dist/0xcert-ethereum-asset-ledger.min.js +++ b/dist/0xcert-ethereum-asset-ledger.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-ethereum-asset-ledger.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,d=r;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,c=67108863&u,l=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=l;f++){var p=h-f|0;d+=(s=(n=0|t.words[p])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|d}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?d[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],f=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:d[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),d=this.clone();if(u){for(a=0;!d.isZero();a++)s=d.andln(255),d.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,w=0|s[4],T=8191&w,M=w>>>13,N=0|s[5],I=8191&N,R=N>>>13,O=0|s[6],b=8191&O,P=O>>>13,S=0|s[7],D=8191&S,L=S>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],z=8191&X,Z=X>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,dt=0|a[8],ct=8191&dt,lt=dt>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(h+(i=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,Y))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,Y))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(v,F)|0,o=Math.imul(v,Y);var mt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,F),n=(n=Math.imul(m,Y))+Math.imul(E,F)|0,o=Math.imul(E,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,K)|0;var Et=(h+(i=i+Math.imul(c,z)|0)|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(g,F)|0,o=Math.imul(g,Y),i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,K)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var yt=(h+(i=i+Math.imul(c,q)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,Y))+Math.imul(M,F)|0,o=Math.imul(M,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,K)|0,i=i+Math.imul(m,z)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var At=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,Y))+Math.imul(R,F)|0,o=Math.imul(R,Y),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,K)|0,i=i+Math.imul(A,z)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(P,F)|0,o=Math.imul(P,Y),i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,K)|0,i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,Z)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var wt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,K)|0,i=i+Math.imul(I,z)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(U,F)|0,o=Math.imul(U,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var Mt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,K)|0,i=i+Math.imul(D,z)|0,n=(n=n+Math.imul(D,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Nt=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,vt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,vt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var Rt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,vt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(I,ut)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var Ot=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,vt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,lt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,lt)|0;var Pt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,vt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(D,ct)|0,n=(n=n+Math.imul(D,lt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,lt)|0;var St=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,lt)|0;var Dt=(h+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ct),n=(n=Math.imul(k,lt))+Math.imul(B,ct)|0,o=Math.imul(B,lt);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=mt,u[2]=Et,u[3]=yt,u[4]=At,u[5]=gt,u[6]=wt,u[7]=Tt,u[8]=Mt,u[9]=Nt,u[10]=It,u[11]=Rt,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=St,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==d||h>=n);h--){var c=0|this.words[h];this.words[h]=d<<26-o|c>>>o,d=c&a}return u&&0!==d&&(u.words[u.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;c--){var l=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,c);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var d=r.clone(),c=e.clone();!e.isZero();){for(var l=0,f=1;0==(e.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(d),s.isub(c)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(d),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},n(y,E),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new A;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},T.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new o(2*d*d).toRed(this);0!==this.pow(d,h).cmp(u);)d.redIAdd(u);for(var c=this.pow(d,n),l=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var h=e.words[i],d=u-1;d>=0;d--){var c=h>>d&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===i&&0===d)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,T),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,d,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,dt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],d=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|d>>>31),r=s^(d<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=d^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(o<<1|s>>>31),r=l^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,dt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut&dt,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~dt&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=ht^~et&it,t[49]=dt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,d=t.blockCount,c=t.outputBlocks,l=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=_-h,t.block=u[d],_=0;_>2]|=r[3&_],t.lastByteIndex===h)for(u[0]=u[d],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];m%d==0&&(o(l),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function d(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},d=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},c=function(t,e){var r=h(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,d=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,h,d,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,dt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],d=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|d>>>31),r=o^(d<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=d^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,dt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut&dt,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~dt&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=ht^~et&it,t[49]=dt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(m))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(y(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(y(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},w=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return l.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return d.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),M=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),d.padZeros(d.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=N.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new M(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new R(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=l.shallowCopy(e)).type=r[1],e=l.deepCopy(e),new U(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):t,r.push(j(this.coerceFunc,e))}),this),d.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):l.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(d.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var d={},c=0;c<10;c++)d[String(c)]=String(c);for(c=0;c<26;c++)d[String.fromCharCode(65+c)]=String(10+c);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=d[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function d(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function c(t){return f(v(t))}function l(t){return new p(d(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",d(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",d(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",d(c(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",d(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return l(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return l(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(h)):this},t.prototype.add=function(t){return l(f(this).add(c(t)))},t.prototype.sub=function(t){return l(f(this).sub(c(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(c(t)))},t.prototype.mul=function(t){return l(f(this).mul(c(t)))},t.prototype.mod=function(t){return l(f(this).mod(c(t)))},t.prototype.pow=function(t){return l(f(this).pow(c(t)))},t.prototype.maskn=function(t){return l(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(c(t))},t.prototype.lt=function(t){return f(this).lt(c(t))},t.prototype.lte=function(t){return f(this).lte(c(t))},t.prototype.gt=function(t){return f(this).gt(c(t))},t.prototype.gte=function(t){return f(this).gte(c(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=c[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+c[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(d(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=l,e.hexDataLength=function(t){return d(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return d(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(d(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return l(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=t,d.type=e,d.count=s.length,h=d,console&&console.warn&&console.warn(h)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=d.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,d=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},6428:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedger=void 0;const n=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),h=r(8260),d=r(8943),c=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),m=r(4583),E=r(5421),y=r(2513),A=r(1999),g=r(1741),w=r(3206),T=r(8661),M=r(195),N=r(8548),I=r(4977),R=r(5289),O=r(1066),b=r(4373),P=r(7877);e.AssetLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),A.default(this,t)}))}getApprovedAccount(t){return i(this,void 0,void 0,(function*(){return w.default(this,t)}))}getAssetAccount(t){return i(this,void 0,void 0,(function*(){return M.default(this,t)}))}getAsset(t){return i(this,void 0,void 0,(function*(){return T.default(this,t)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),I.default(this,t)}))}getCapabilities(){return i(this,void 0,void 0,(function*(){return R.default(this)}))}getInfo(){return i(this,void 0,void 0,(function*(){return O.default(this)}))}getAssetIdAt(t){return i(this,void 0,void 0,(function*(){return N.default(this,t)}))}getAccountAssetIdAt(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),g.default(this,t,e)}))}isApprovedAccount(t,e){return i(this,void 0,void 0,(function*(){return(e=this._provider.encoder.normalizeAddress(e))===(yield w.default(this,t))}))}isTransferable(){return i(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(t,e){return i(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)}))}disapproveAccount(t){return i(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)}))}grantAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),d.default(this,t,o.getBitfieldFromAbilities(e))}))}setAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),p.default(this,t,o.getBitfieldFromAbilities(e))}))}createAsset(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.receiverId);return a.default(this,e,t.id,`0x${t.imprint}`)}))}destroyAsset(t){return i(this,void 0,void 0,(function*(){return h.default(this,t)}))}revokeAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t,o.getBitfieldFromAbilities(e))}))}revokeAsset(t){return i(this,void 0,void 0,(function*(){return l.default(this,t)}))}transferAsset(t){return i(this,void 0,void 0,(function*(){t.senderId||(t.senderId=this.provider.accountId);const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(t.receiverId)?m.default(this,e,r,t.id):f.default(this,e,r,t.id,t.data)}))}enableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(t,e){return i(this,void 0,void 0,(function*(){return y.default(this,t,`0x${e.imprint}`)}))}update(t){return i(this,void 0,void 0,(function*(){return E.default(this,t.uriPrefix,t.uriPostfix)}))}approveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!0)}))}disapproveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!1)}))}isApprovedOperator(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),b.default(this,t,e)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:n.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:n.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(e,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(e,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(e,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),n(r(6428),e),n(r(365),e),n(r(5378),e)},5378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBitfieldFromAbilities=void 0;const i=r(2624);e.getBitfieldFromAbilities=function(t){let e=i.bigNumberify(0);return t.forEach((t=>{e=e.add(t)})),e.toHexString()}},365:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInterfaceCode=void 0;const i=r(6112);e.getInterfaceCode=function(t){return t==i.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==i.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==i.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":t==i.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},212:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256","bytes32"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xb0e329e4"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},3967:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriPrefix:u,uriPostfix:h,schemaId:d,capabilities:c}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(c||[]).map((t=>s.getInterfaceCode(t))),f={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(a,[e,r,u,h,`0x${d}`,l]).substr(2)}`},p=yield t.post({method:"eth_sendTransaction",params:[f]});return new n.Mutation(t,p.result)}))}},8260:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x9d118770"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},8943:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0ab319e8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},4494:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xf394b6df"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x20c5429b"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},1463:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279);e.default=function(t,e,r,o,s){return i(this,void 0,void 0,(function*(){const i=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[e,r,o,s].filter((t=>void 0!==t)),h={from:t.provider.accountId,to:t.id,data:i+t.provider.encoder.encodeParameters(a,u).substr(2)},d=yield t.provider.post({method:"eth_sendTransaction",params:[h]});return new n.Mutation(t.provider,d.result,t)}))}},7234:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x15ec3b8b"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3016:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","bool"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa22cb465"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5641:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0xbedb86fb"+t.provider.encoder.encodeParameters(o,[!e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},4583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},2513:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256","bytes32"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0d04c3b8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5421:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["string","string"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x89b73ec0"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1999:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=["address","uint256"],s=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){return Promise.all([n.SuperAssetLedgerAbility.MANAGE_ABILITIES,n.GeneralAssetLedgerAbility.CREATE_ASSET,n.GeneralAssetLedgerAbility.REVOKE_ASSET,n.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,n.GeneralAssetLedgerAbility.UPDATE_ASSET,n.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,n.GeneralAssetLedgerAbility.UPDATE_URI_BASE,n.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>i(this,void 0,void 0,(function*(){const i={to:t.id,data:"0xba00a330"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]?r:-1}))))).then((t=>t.filter((t=>-1!==t)).sort(((t,e)=>t-e)))).catch((e=>(t.provider.log(e),[])))}))}},1741:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","uint256"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x2f745c59"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},3206:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(9512),o=["uint256"],s=["address"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x081812fc"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,i.result)[0]}catch(r){return t.provider.log(r),n.default(t,e)}}))}},195:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x6352211e"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8548:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x4f6ccce7"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8661:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];e.default=function(t,e){return r(this,void 0,void 0,(function*(){const n=yield Promise.all(i.map((i=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:i.signature+t.provider.encoder.encodeParameters(i.inputTypes,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(i.outputTypes,n.result)[0]}catch(e){return t.provider.log(e),null}})))));return{id:e,uri:n[0],imprint:n[1]?n[1].substr(2):null,schemaId:n[2]?n[2].substr(2):null}}))}},4977:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},5289:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=r(365),s=["bytes4"],a=["bool"];e.default=function(t){return i(this,void 0,void 0,(function*(){return Promise.all([n.AssetLedgerCapability.DESTROY_ASSET,n.AssetLedgerCapability.REVOKE_ASSET,n.AssetLedgerCapability.TOGGLE_TRANSFERS,n.AssetLedgerCapability.UPDATE_ASSET].map((e=>i(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(e),i={to:t.id,data:"0x01ffc9a7"+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(a,n.result)[0]?e:-1}))))).then((t=>t.filter((t=>-1!==t)).sort())).catch((e=>(t.provider.log(e),[])))}))}},1066:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],uriPrefix:e[2],uriPostfix:e[3],supply:e[4]}}))}},4373:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["bool"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xe985e9c5"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},7877:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[],n=["bool"];e.default=function(t){return r(this,void 0,void 0,(function*(){try{const e={to:t.id,data:"0xb187bd26"+t.provider.encoder.encodeParameters(i,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(n,r.result)[0]}catch(e){return t.provider.log(e),null}}))}},9512:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x481af3d3"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5291))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,d=r;d1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,c=67108863&u,l=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=l;f++){var p=h-f|0;d+=(s=(n=0|t.words[p])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,u=0|d}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?d[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],f=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:d[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),d=this.clone();if(u){for(a=0;!d.isZero();a++)s=d.andln(255),d.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,w=0|s[4],T=8191&w,M=w>>>13,N=0|s[5],I=8191&N,R=N>>>13,O=0|s[6],b=8191&O,P=O>>>13,S=0|s[7],D=8191&S,L=S>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],z=8191&X,Z=X>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,dt=0|a[8],ct=8191&dt,lt=dt>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(h+(i=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,Y))+Math.imul(l,F)|0))<<13)|0;h=((o=Math.imul(l,Y))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(v,F)|0,o=Math.imul(v,Y);var mt=(h+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(l,W)|0))<<13)|0;h=((o=o+Math.imul(l,K)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,F),n=(n=Math.imul(m,Y))+Math.imul(E,F)|0,o=Math.imul(E,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,K)|0;var Et=(h+(i=i+Math.imul(c,z)|0)|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(l,z)|0))<<13)|0;h=((o=o+Math.imul(l,Z)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(g,F)|0,o=Math.imul(g,Y),i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,K)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var yt=(h+(i=i+Math.imul(c,q)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(l,q)|0))<<13)|0;h=((o=o+Math.imul(l,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,Y))+Math.imul(M,F)|0,o=Math.imul(M,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,K)|0,i=i+Math.imul(m,z)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var At=(h+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;h=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,Y))+Math.imul(R,F)|0,o=Math.imul(R,Y),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,K)|0,i=i+Math.imul(A,z)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(h+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(l,rt)|0))<<13)|0;h=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(P,F)|0,o=Math.imul(P,Y),i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,K)|0,i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,Z)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var wt=(h+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;h=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,K)|0,i=i+Math.imul(I,z)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(h+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,ht)|0)+Math.imul(l,ut)|0))<<13)|0;h=((o=o+Math.imul(l,ht)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(U,F)|0,o=Math.imul(U,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var Mt=(h+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;h=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,K)|0,i=i+Math.imul(D,z)|0,n=(n=n+Math.imul(D,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,ht)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,ht)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Nt=(h+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,vt)|0)+Math.imul(l,pt)|0))<<13)|0;h=((o=o+Math.imul(l,vt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var It=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,ht)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var Rt=(h+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,vt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(I,ut)|0,n=(n=n+Math.imul(I,ht)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,ht)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var Ot=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,vt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,lt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,lt)|0;var Pt=(h+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,vt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(D,ct)|0,n=(n=n+Math.imul(D,lt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,lt)|0;var St=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,lt)|0;var Dt=(h+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ct),n=(n=Math.imul(k,lt))+Math.imul(B,ct)|0,o=Math.imul(B,lt);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=mt,u[2]=Et,u[3]=yt,u[4]=At,u[5]=gt,u[6]=wt,u[7]=Tt,u[8]=Mt,u[9]=Nt,u[10]=It,u[11]=Rt,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=St,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e),r},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==d||h>=n);h--){var c=0|this.words[h];this.words[h]=d<<26-o|c>>>o,d=c&a}return u&&0!==d&&(u.words[u.length++]=d),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;c--){var l=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,c);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var d=r.clone(),c=e.clone();!e.isZero();){for(var l=0,f=1;0==(e.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(d),s.isub(c)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(d),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,d=1;0==(e.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},n(y,E),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new A;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},T.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),d=this.m.bitLength();for(d=new o(2*d*d).toRed(this);0!==this.pow(d,h).cmp(u);)d.redIAdd(u);for(var c=this.pow(d,n),l=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var h=e.words[i],d=u-1;d>=0;d--){var c=h>>d&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===i&&0===d)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,T),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,d,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,dt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],d=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|d>>>31),r=s^(d<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=d^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(o<<1|s>>>31),r=l^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,dt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut&dt,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~dt&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=ht^~et&it,t[49]=dt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,d=t.blockCount,c=t.outputBlocks,l=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=_-h,t.block=u[d],_=0;_>2]|=r[3&_],t.lastByteIndex===h)for(u[0]=u[d],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];m%d==0&&(o(l),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function d(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},d=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},c=function(t,e){var r=h(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,d=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,h,d,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,dt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],d=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|d>>>31),r=o^(d<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=d^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,dt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut&dt,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~dt&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=ht^~et&it,t[49]=dt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(m))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(y(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(y(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},w=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return l.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return d.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),M=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),d.padZeros(d.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=N.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new M(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new R(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=l.shallowCopy(e)).type=r[1],e=l.deepCopy(e),new U(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):t,r.push(j(this.coerceFunc,e))}),this),d.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):l.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(d.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var d={},c=0;c<10;c++)d[String(c)]=String(c);for(c=0;c<26;c++)d[String.fromCharCode(65+c)]=String(10+c);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=d[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function d(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function c(t){return f(v(t))}function l(t){return new p(d(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",d(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",d(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",d(c(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",d(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return l(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return l(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(h)):this},t.prototype.add=function(t){return l(f(this).add(c(t)))},t.prototype.sub=function(t){return l(f(this).sub(c(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(c(t)))},t.prototype.mul=function(t){return l(f(this).mul(c(t)))},t.prototype.mod=function(t){return l(f(this).mod(c(t)))},t.prototype.pow=function(t){return l(f(this).pow(c(t)))},t.prototype.maskn=function(t){return l(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(c(t))},t.prototype.lt=function(t){return f(this).lt(c(t))},t.prototype.lte=function(t){return f(this).lte(c(t))},t.prototype.gt=function(t){return f(this).gt(c(t))},t.prototype.gte=function(t){return f(this).gte(c(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=c[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+c[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(d(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=l,e.hexDataLength=function(t){return d(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return d(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(d(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return l(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var d=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");d.name="MaxListenersExceededWarning",d.emitter=t,d.type=e,d.count=s.length,h=d,console&&console.warn&&console.warn(h)}return t}function d(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=d.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,d=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},6428:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedger=void 0;const n=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),h=r(8260),d=r(8943),c=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),m=r(4583),E=r(5421),y=r(2513),A=r(1999),g=r(1741),w=r(3206),T=r(8661),M=r(195),N=r(8548),I=r(4977),R=r(5289),O=r(1066),b=r(4373),P=r(7877);e.AssetLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),A.default(this,t)}))}getApprovedAccount(t){return i(this,void 0,void 0,(function*(){return w.default(this,t)}))}getAssetAccount(t){return i(this,void 0,void 0,(function*(){return M.default(this,t)}))}getAsset(t){return i(this,void 0,void 0,(function*(){return T.default(this,t)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),I.default(this,t)}))}getCapabilities(){return i(this,void 0,void 0,(function*(){return R.default(this)}))}getInfo(){return i(this,void 0,void 0,(function*(){return O.default(this)}))}getAssetIdAt(t){return i(this,void 0,void 0,(function*(){return N.default(this,t)}))}getAccountAssetIdAt(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),g.default(this,t,e)}))}isApprovedAccount(t,e){return i(this,void 0,void 0,(function*(){return(e=this._provider.encoder.normalizeAddress(e))===(yield w.default(this,t))}))}isTransferable(){return i(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(t,e){return i(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)}))}disapproveAccount(t){return i(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)}))}grantAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),d.default(this,t,o.getBitfieldFromAbilities(e))}))}setAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),p.default(this,t,o.getBitfieldFromAbilities(e))}))}createAsset(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.receiverId);return a.default(this,e,t.id,`0x${t.imprint}`)}))}destroyAsset(t){return i(this,void 0,void 0,(function*(){return h.default(this,t)}))}revokeAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t,o.getBitfieldFromAbilities(e))}))}revokeAsset(t){return i(this,void 0,void 0,(function*(){return l.default(this,t)}))}transferAsset(t){return i(this,void 0,void 0,(function*(){t.senderId||(t.senderId=this.provider.accountId);const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(t.receiverId)?m.default(this,e,r,t.id):f.default(this,e,r,t.id,t.data)}))}enableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(t,e){return i(this,void 0,void 0,(function*(){return y.default(this,t,`0x${e.imprint}`)}))}update(t){return i(this,void 0,void 0,(function*(){return E.default(this,t.uriPrefix,t.uriPostfix)}))}approveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!0)}))}disapproveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!1)}))}isApprovedOperator(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),b.default(this,t,e)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:n.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:n.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(e,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(e,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(e,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),n(r(6428),e),n(r(365),e),n(r(5378),e)},5378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBitfieldFromAbilities=void 0;const i=r(2624);e.getBitfieldFromAbilities=function(t){let e=i.bigNumberify(0);return t.forEach((t=>{e=e.add(t)})),e.toHexString()}},365:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInterfaceCode=void 0;const i=r(6112);e.getInterfaceCode=function(t){return t==i.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==i.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==i.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":t==i.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},212:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256","bytes32"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xb0e329e4"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},3967:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriPrefix:u,uriPostfix:h,schemaId:d,capabilities:c}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(c||[]).map((t=>s.getInterfaceCode(t))),f={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(a,[e,r,u,h,`0x${d}`,l]).substr(2)}`},p=yield t.post({method:"eth_sendTransaction",params:[f]});return new n.Mutation(t,p.result)}))}},8260:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x9d118770"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},8943:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0ab319e8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},4494:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xf394b6df"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x20c5429b"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},1463:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279);e.default=function(t,e,r,o,s){return i(this,void 0,void 0,(function*(){const i=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[e,r,o,s].filter((t=>void 0!==t)),h={from:t.provider.accountId,to:t.id,data:i+t.provider.encoder.encodeParameters(a,u).substr(2)},d=yield t.provider.post({method:"eth_sendTransaction",params:[h]});return new n.Mutation(t.provider,d.result,t)}))}},7234:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x15ec3b8b"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3016:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","bool"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa22cb465"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5641:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0xbedb86fb"+t.provider.encoder.encodeParameters(o,[!e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},4583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},2513:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256","bytes32"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0d04c3b8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5421:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["string","string"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x89b73ec0"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1999:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=["address","uint256"],s=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){return Promise.all([n.SuperAssetLedgerAbility.MANAGE_ABILITIES,n.GeneralAssetLedgerAbility.CREATE_ASSET,n.GeneralAssetLedgerAbility.REVOKE_ASSET,n.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,n.GeneralAssetLedgerAbility.UPDATE_ASSET,n.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,n.GeneralAssetLedgerAbility.UPDATE_URI_BASE,n.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>i(this,void 0,void 0,(function*(){const i={to:t.id,data:"0xba00a330"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]?r:-1}))))).then((t=>t.filter((t=>-1!==t)).sort(((t,e)=>t-e)))).catch((e=>(t.provider.log(e),[])))}))}},1741:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","uint256"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x2f745c59"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},3206:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(9512),o=["uint256"],s=["address"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x081812fc"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,i.result)[0]}catch(r){return t.provider.log(r),n.default(t,e)}}))}},195:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x6352211e"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8548:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x4f6ccce7"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8661:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];e.default=function(t,e){return r(this,void 0,void 0,(function*(){const n=yield Promise.all(i.map((i=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:i.signature+t.provider.encoder.encodeParameters(i.inputTypes,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(i.outputTypes,n.result)[0]}catch(e){return t.provider.log(e),null}})))));return{id:e,uri:n[0],imprint:n[1]?n[1].substr(2):null,schemaId:n[2]?n[2].substr(2):null}}))}},4977:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},5289:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=r(365),s=["bytes4"],a=["bool"];e.default=function(t){return i(this,void 0,void 0,(function*(){return Promise.all([n.AssetLedgerCapability.DESTROY_ASSET,n.AssetLedgerCapability.REVOKE_ASSET,n.AssetLedgerCapability.TOGGLE_TRANSFERS,n.AssetLedgerCapability.UPDATE_ASSET].map((e=>i(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(e),i={to:t.id,data:"0x01ffc9a7"+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(a,n.result)[0]?e:-1}))))).then((t=>t.filter((t=>-1!==t)).sort())).catch((e=>(t.provider.log(e),[])))}))}},1066:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],uriPrefix:e[2],uriPostfix:e[3],supply:e[4]}}))}},4373:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["bool"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xe985e9c5"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},7877:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[],n=["bool"];e.default=function(t){return r(this,void 0,void 0,(function*(){try{const e={to:t.id,data:"0xb187bd26"+t.provider.encoder.encodeParameters(i,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(n,r.result)[0]}catch(e){return t.provider.log(e),null}}))}},9512:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x481af3d3"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5291))})(); \ No newline at end of file diff --git a/dist/0xcert-ethereum-gateway.min.js b/dist/0xcert-ethereum-gateway.min.js index eb9cff3a9..e28d64c1c 100644 --- a/dist/0xcert-ethereum-gateway.min.js +++ b/dist/0xcert-ethereum-gateway.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-ethereum-gateway.min.js.LICENSE.txt */ -(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,I=0|s[4],O=8191&I,T=I>>>13,R=0|s[5],w=8191&R,N=R>>>13,b=0|s[6],M=8191&b,P=b>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,G=0|s[9],U=8191&G,j=G>>>13,F=0|a[0],B=8191&F,K=F>>>13,Y=0|a[1],V=8191&Y,z=Y>>>13,X=0|a[2],H=8191&X,W=X>>>13,Z=0|a[3],$=8191&Z,q=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,B))|0)+((8191&(i=(i=Math.imul(h,K))+Math.imul(l,B)|0))<<13)|0;d=((o=Math.imul(l,K))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,K))+Math.imul(v,B)|0,o=Math.imul(v,K);var Ee=(d+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,V)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,K))+Math.imul(m,B)|0,o=Math.imul(m,K),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,z)|0;var me=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,B),i=(i=Math.imul(A,K))+Math.imul(g,B)|0,o=Math.imul(g,K),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,$)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(O,B),i=(i=Math.imul(O,K))+Math.imul(T,B)|0,o=Math.imul(T,K),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,z)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,q)|0;var Ae=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(w,B),i=(i=Math.imul(w,K))+Math.imul(N,B)|0,o=Math.imul(N,K),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,z)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var ge=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,K))+Math.imul(P,B)|0,o=Math.imul(P,K),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,z)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Ie=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,B),i=(i=Math.imul(D,K))+Math.imul(x,B)|0,o=Math.imul(x,K),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Oe=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,K))+Math.imul(k,B)|0,o=Math.imul(k,K),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,B),i=(i=Math.imul(U,K))+Math.imul(j,B)|0,o=Math.imul(j,K),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var Re=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,z))+Math.imul(j,V)|0,o=Math.imul(j,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,de)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Ne=(d+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(m,pe)|0))<<13)|0;d=((o=o+Math.imul(m,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,de)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var be=(d+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ve)|0)+Math.imul(g,pe)|0))<<13)|0;d=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Me=(d+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(N,pe)|0))<<13)|0;d=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;d=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,ue),i=(i=Math.imul(U,de))+Math.imul(j,ue)|0,o=Math.imul(j,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(U,he),i=(i=Math.imul(U,le))+Math.imul(j,he)|0,o=Math.imul(j,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ve))+Math.imul(j,pe)|0))<<13)|0;return d=((o=Math.imul(j,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=Ee,u[2]=me,u[3]=ye,u[4]=Ae,u[5]=ge,u[6]=Ie,u[7]=Oe,u[8]=Te,u[9]=Re,u[10]=we,u[11]=Ne,u[12]=be,u[13]=Me,u[14]=Pe,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var E={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(y,m),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(E[e])return E[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new A;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return E[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,O),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,I,O,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,B,K,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,I=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,O=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&I,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&B,e[23]=U^~F&K,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&O,e[5]=A^~I&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~B&Y,e[25]=F^~K&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~O&v,e[7]=I^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=B^~Y&C,e[27]=K^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=O^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];E%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new A(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new A(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new A(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}A.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(g(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&g(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var g=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,I,O,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,B,K,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,I=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,O=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&I,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&B,e[23]=U^~F&K,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&O,e[5]=A^~I&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~B&Y,e[25]=F^~K&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~O&v,e[7]=I^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=B^~Y&C,e[27]=K^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=O^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(E))throw new Error('invalid identifier: "'+n[1]+'"');if(U(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var g=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},I=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(g),O=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(g),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=R.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new N(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new G(e,n,r)}(e,t.components,t.name):""===t.type?new O(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var B=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new G(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new G(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=B,t.defaultAbiCoder=new B},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},6428:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const i=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),c=r(8943),h=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),E=r(4583),m=r(5421),y=r(2513),A=r(1999),g=r(1741),I=r(3206),O=r(8661),T=r(195),R=r(8548),w=r(4977),N=r(5289),b=r(1066),M=r(4373),P=r(7877);t.AssetLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getAbilities(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),A.default(this,e)}))}getApprovedAccount(e){return n(this,void 0,void 0,(function*(){return I.default(this,e)}))}getAssetAccount(e){return n(this,void 0,void 0,(function*(){return T.default(this,e)}))}getAsset(e){return n(this,void 0,void 0,(function*(){return O.default(this,e)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),w.default(this,e)}))}getCapabilities(){return n(this,void 0,void 0,(function*(){return N.default(this)}))}getInfo(){return n(this,void 0,void 0,(function*(){return b.default(this)}))}getAssetIdAt(e){return n(this,void 0,void 0,(function*(){return R.default(this,e)}))}getAccountAssetIdAt(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),g.default(this,e,t)}))}isApprovedAccount(e,t){return n(this,void 0,void 0,(function*(){return(t=this._provider.encoder.normalizeAddress(t))===(yield I.default(this,e))}))}isTransferable(){return n(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(e,t){return n(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),s.default(this,t,e)}))}disapproveAccount(e){return n(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",e)}))}grantAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),c.default(this,e,o.getBitfieldFromAbilities(t))}))}setAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),p.default(this,e,o.getBitfieldFromAbilities(t))}))}createAsset(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.receiverId);return a.default(this,t,e.id,`0x${e.imprint}`)}))}destroyAsset(e){return n(this,void 0,void 0,(function*(){return d.default(this,e)}))}revokeAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),h.default(this,e,o.getBitfieldFromAbilities(t))}))}revokeAsset(e){return n(this,void 0,void 0,(function*(){return l.default(this,e)}))}transferAsset(e){return n(this,void 0,void 0,(function*(){e.senderId||(e.senderId=this.provider.accountId);const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(e.receiverId)?E.default(this,t,r,e.id):f.default(this,t,r,e.id,e.data)}))}enableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(e,t){return n(this,void 0,void 0,(function*(){return y.default(this,e,`0x${t.imprint}`)}))}update(e){return n(this,void 0,void 0,(function*(){return m.default(this,e.uriPrefix,e.uriPostfix)}))}approveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!0)}))}disapproveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!1)}))}isApprovedOperator(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),M.default(this,e,t)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:i.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(6428),t),i(r(365),t),i(r(5378),t)},5378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),E=r(8634),m=r(7045),y=r(5636),A=r(6075),g=r(8608),I=r(1785),O=r(7461),T=r(2746),R=r(3924),w=r(5434),N=r(6651),b=r(8453),M=r(9085),P=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),G=r(1399),U=r(9156),j=r(3022),F=r(9669),B=r(7734),K=r(4909),Y=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?O.default(this,e):I.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?O.default(this,e):I.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?b.default(this,e):N.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):j.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),E.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),m.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=Y.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case Y.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=Y.ProxyId.NFTOKEN_TRANSFER);break;case Y.ProxyKind.CREATE_ASSET:t=Y.ProxyId.XCERT_CREATE;break;case Y.ProxyKind.DESTROY_ASSET:t=Y.ProxyId.XCERT_BURN;break;case Y.ProxyKind.MANAGE_ABILITIES:t=Y.ProxyId.MANAGE_ABILITIES;break;case Y.ProxyKind.TRANSFER_TOKEN:t=Y.ProxyId.TOKEN_TRANSFER;break;case Y.ProxyKind.UPDATE_ASSET:t=Y.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return R.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),U.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(8344))})(); \ No newline at end of file +(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,I=0|s[4],O=8191&I,T=I>>>13,R=0|s[5],w=8191&R,N=R>>>13,b=0|s[6],M=8191&b,P=b>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,G=0|s[9],U=8191&G,j=G>>>13,F=0|a[0],B=8191&F,K=F>>>13,Y=0|a[1],V=8191&Y,z=Y>>>13,X=0|a[2],H=8191&X,W=X>>>13,Z=0|a[3],$=8191&Z,q=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,B))|0)+((8191&(i=(i=Math.imul(h,K))+Math.imul(l,B)|0))<<13)|0;d=((o=Math.imul(l,K))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,K))+Math.imul(v,B)|0,o=Math.imul(v,K);var Ee=(d+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,V)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,K))+Math.imul(m,B)|0,o=Math.imul(m,K),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,z)|0;var me=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,B),i=(i=Math.imul(A,K))+Math.imul(g,B)|0,o=Math.imul(g,K),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,$)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(O,B),i=(i=Math.imul(O,K))+Math.imul(T,B)|0,o=Math.imul(T,K),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,z)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,q)|0;var Ae=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(w,B),i=(i=Math.imul(w,K))+Math.imul(N,B)|0,o=Math.imul(N,K),n=n+Math.imul(O,V)|0,i=(i=i+Math.imul(O,z)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var ge=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,K))+Math.imul(P,B)|0,o=Math.imul(P,K),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,z)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Ie=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(D,B),i=(i=Math.imul(D,K))+Math.imul(x,B)|0,o=Math.imul(x,K),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Oe=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,K))+Math.imul(k,B)|0,o=Math.imul(k,K),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,B),i=(i=Math.imul(U,K))+Math.imul(j,B)|0,o=Math.imul(j,K),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var Re=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,z))+Math.imul(j,V)|0,o=Math.imul(j,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,de)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Ne=(d+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(m,pe)|0))<<13)|0;d=((o=o+Math.imul(m,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,de)|0,n=n+Math.imul(O,he)|0,i=(i=i+Math.imul(O,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var be=(d+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ve)|0)+Math.imul(g,pe)|0))<<13)|0;d=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Me=(d+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(N,pe)|0))<<13)|0;d=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;d=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,ue),i=(i=Math.imul(U,de))+Math.imul(j,ue)|0,o=Math.imul(j,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(U,he),i=(i=Math.imul(U,le))+Math.imul(j,he)|0,o=Math.imul(j,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ve))+Math.imul(j,pe)|0))<<13)|0;return d=((o=Math.imul(j,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=Ee,u[2]=me,u[3]=ye,u[4]=Ae,u[5]=ge,u[6]=Ie,u[7]=Oe,u[8]=Te,u[9]=Re,u[10]=we,u[11]=Ne,u[12]=be,u[13]=Me,u[14]=Pe,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new O(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var E={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function I(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function O(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){O.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(y,m),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(E[e])return E[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new A;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new I}return E[e]=t,t},O.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},O.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},O.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},O.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},O.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},O.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},O.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},O.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},O.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},O.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},O.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},O.prototype.isqr=function(e){return this.imul(e,e.clone())},O.prototype.sqr=function(e){return this.mul(e,e)},O.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},O.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},O.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,O),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,I,O,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,B,K,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,I=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,O=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&I,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&B,e[23]=U^~F&K,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&O,e[5]=A^~I&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~B&Y,e[25]=F^~K&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~O&v,e[7]=I^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=B^~Y&C,e[27]=K^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=O^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];E%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new A(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new A(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new A(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}A.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(g(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&g(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var g=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,I,O,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,B,K,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,I=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,O=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&I,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&B,e[23]=U^~F&K,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&O,e[5]=A^~I&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~B&Y,e[25]=F^~K&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~O&v,e[7]=I^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=B^~Y&C,e[27]=K^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=O^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(E))throw new Error('invalid identifier: "'+n[1]+'"');if(U(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var g=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},I=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(g),O=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(g),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=R.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new N(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new G(e,n,r)}(e,t.components,t.name):""===t.type?new O(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var B=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new G(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new G(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=B,t.defaultAbiCoder=new B},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},6428:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const i=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),c=r(8943),h=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),E=r(4583),m=r(5421),y=r(2513),A=r(1999),g=r(1741),I=r(3206),O=r(8661),T=r(195),R=r(8548),w=r(4977),N=r(5289),b=r(1066),M=r(4373),P=r(7877);t.AssetLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getAbilities(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),A.default(this,e)}))}getApprovedAccount(e){return n(this,void 0,void 0,(function*(){return I.default(this,e)}))}getAssetAccount(e){return n(this,void 0,void 0,(function*(){return T.default(this,e)}))}getAsset(e){return n(this,void 0,void 0,(function*(){return O.default(this,e)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),w.default(this,e)}))}getCapabilities(){return n(this,void 0,void 0,(function*(){return N.default(this)}))}getInfo(){return n(this,void 0,void 0,(function*(){return b.default(this)}))}getAssetIdAt(e){return n(this,void 0,void 0,(function*(){return R.default(this,e)}))}getAccountAssetIdAt(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),g.default(this,e,t)}))}isApprovedAccount(e,t){return n(this,void 0,void 0,(function*(){return(t=this._provider.encoder.normalizeAddress(t))===(yield I.default(this,e))}))}isTransferable(){return n(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(e,t){return n(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),s.default(this,t,e)}))}disapproveAccount(e){return n(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",e)}))}grantAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),c.default(this,e,o.getBitfieldFromAbilities(t))}))}setAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),p.default(this,e,o.getBitfieldFromAbilities(t))}))}createAsset(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.receiverId);return a.default(this,t,e.id,`0x${e.imprint}`)}))}destroyAsset(e){return n(this,void 0,void 0,(function*(){return d.default(this,e)}))}revokeAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),h.default(this,e,o.getBitfieldFromAbilities(t))}))}revokeAsset(e){return n(this,void 0,void 0,(function*(){return l.default(this,e)}))}transferAsset(e){return n(this,void 0,void 0,(function*(){e.senderId||(e.senderId=this.provider.accountId);const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(e.receiverId)?E.default(this,t,r,e.id):f.default(this,t,r,e.id,e.data)}))}enableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(e,t){return n(this,void 0,void 0,(function*(){return y.default(this,e,`0x${t.imprint}`)}))}update(e){return n(this,void 0,void 0,(function*(){return m.default(this,e.uriPrefix,e.uriPostfix)}))}approveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!0)}))}disapproveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!1)}))}isApprovedOperator(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),M.default(this,e,t)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:i.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(6428),t),i(r(365),t),i(r(5378),t)},5378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),E=r(8634),m=r(7045),y=r(5636),A=r(6075),g=r(8608),I=r(1785),O=r(7461),T=r(2746),R=r(3924),w=r(5434),N=r(6651),b=r(8453),M=r(9085),P=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),G=r(1399),U=r(9156),j=r(3022),F=r(9669),B=r(7734),K=r(4909),Y=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?O.default(this,e):I.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?O.default(this,e):I.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?b.default(this,e):N.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):j.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),E.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),m.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=Y.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case Y.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=Y.ProxyId.NFTOKEN_TRANSFER);break;case Y.ProxyKind.CREATE_ASSET:t=Y.ProxyId.XCERT_CREATE;break;case Y.ProxyKind.DESTROY_ASSET:t=Y.ProxyId.XCERT_BURN;break;case Y.ProxyKind.MANAGE_ABILITIES:t=Y.ProxyId.MANAGE_ABILITIES;break;case Y.ProxyKind.TRANSFER_TOKEN:t=Y.ProxyId.TOKEN_TRANSFER;break;case Y.ProxyKind.UPDATE_ASSET:t=Y.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return R.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),U.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(8344))})(); \ No newline at end of file diff --git a/dist/0xcert-ethereum-http-provider.min.js b/dist/0xcert-ethereum-http-provider.min.js index d41162f2f..b685740d0 100644 --- a/dist/0xcert-ethereum-http-provider.min.js +++ b/dist/0xcert-ethereum-http-provider.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-ethereum-http-provider.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var _=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?_+r:l[h-_.length]+_+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,_=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,A=0|s[3],g=8191&A,y=A>>>13,N=0|s[4],M=8191&N,T=N>>>13,R=0|s[5],w=8191&R,I=R>>>13,O=0|s[6],b=8191&O,S=O>>>13,D=0|s[7],P=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|a[0],j=8191&F,Y=F>>>13,V=0|a[1],W=8191&V,X=V>>>13,K=0|a[2],Z=8191&K,H=K>>>13,z=0|a[3],q=8191&z,$=z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,_t=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,j))|0)+((8191&(n=(n=Math.imul(d,Y))+Math.imul(c,j)|0))<<13)|0;h=((o=Math.imul(c,Y))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,Y))+Math.imul(_,j)|0,o=Math.imul(_,Y);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,Y))+Math.imul(m,j)|0,o=Math.imul(m,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,H)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(g,j),n=(n=Math.imul(g,Y))+Math.imul(y,j)|0,o=Math.imul(y,Y),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,H)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(M,j),n=(n=Math.imul(M,Y))+Math.imul(T,j)|0,o=Math.imul(T,Y),i=i+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,H)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0;var gt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,Y))+Math.imul(I,j)|0,o=Math.imul(I,Y),i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,H)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,Y))+Math.imul(S,j)|0,o=Math.imul(S,Y),i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,H)|0,i=i+Math.imul(g,q)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0;var Nt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(P,j),n=(n=Math.imul(P,Y))+Math.imul(L,j)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,H)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,H)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0;var Mt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,Y))+Math.imul(U,j)|0,o=Math.imul(U,Y),i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,Y))+Math.imul(B,j)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,H)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(_,dt)|0,o=o+Math.imul(_,ct)|0;var Rt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,_t)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,_t)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,H)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var wt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,_t)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,_t)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,Z),n=(n=Math.imul(k,H))+Math.imul(B,Z)|0,o=Math.imul(B,H),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(g,dt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,_t)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,_t)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var Ot=(h+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,_t)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,_t)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(w,dt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,_t)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,_t)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,_t)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,_t)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(P,dt)|0,n=(n=n+Math.imul(P,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,_t)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,_t)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Pt=(h+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,_t)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,_t)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,_t)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,_t)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,_t))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,_t))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=At,u[4]=gt,u[5]=yt,u[6]=Nt,u[7]=Mt,u[8]=Tt,u[9]=Rt,u[10]=wt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=St,u[15]=Dt,u[16]=Pt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function _(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):_(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,_=1;0==(r.words[0]&_)&&p<26;++p,_<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function N(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new g;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new N}return E[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var _=f,v=0;0!==_.cmp(a);v++)_=_.redSqr();i(v=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,_,v,E,m,A,g,y,N,M,T,R,w,I,O,b,S,D,P,L,C,x,U,G,k,B,F,j,Y,V,W,X,K,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,R=t[6]<<28|t[7]>>>4,w=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,N=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&A,t[1]=v^~m&g,t[10]=R^~I&b,t[11]=w^~O&S,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~Z&z,t[31]=K^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&y,t[3]=m^~g&N,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~B&j,t[23]=k^~F&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~y&M,t[5]=g^~N&T,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=B^~j&V,t[25]=F^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~M&_,t[7]=N^~T&v,t[16]=D^~L&R,t[17]=P^~C&w,t[26]=j^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~_&E,t[9]=T^~v&m,t[18]=L^~R&I,t[19]=C^~w&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~X&Z,t[39]=tt^~K&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[v>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=v-h,t.block=u[l],v=0;v>2]|=r[3&v],t.lastByteIndex===h)for(u[0]=u[l],v=1;v>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),v=0)}return"0x"+_})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new g(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new g(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new g(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}g.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,_,v,E,m,A,g,y,N,M,T,R,w,I,O,b,S,D,P,L,C,x,U,G,k,B,F,j,Y,V,W,X,K,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,R=t[6]<<28|t[7]>>>4,w=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,N=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&A,t[1]=v^~m&g,t[10]=R^~I&b,t[11]=w^~O&S,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~Z&z,t[31]=K^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&y,t[3]=m^~g&N,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~B&j,t[23]=k^~F&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~y&M,t[5]=g^~N&T,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=B^~j&V,t[25]=F^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~M&_,t[7]=N^~T&v,t[16]=D^~L&R,t[17]=P^~C&w,t[26]=j^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~_&E,t[9]=T^~v&m,t[18]=L^~R&I,t[19]=C^~w&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~X&Z,t[39]=tt^~K&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(_=0;_2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},N=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=R.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(_)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function _(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=_,e.getIcapAddress=function(t){for(var e=new n.default.BN(_(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return _("0x"+s.keccak256(a.encode([_(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=_(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),_("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(_(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return _(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function _(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=_},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&_(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},6841:function(t,e,r){"use strict";var i=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);nt)).then((t=>e(null,t))).catch((t=>e(t,null)))}}e.HttpProvider=s},4079:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(3279),e),n(r(6841),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(4079))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var _=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?_+r:l[h-_.length]+_+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,_=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,A=0|s[3],g=8191&A,y=A>>>13,N=0|s[4],M=8191&N,T=N>>>13,R=0|s[5],w=8191&R,I=R>>>13,O=0|s[6],b=8191&O,S=O>>>13,D=0|s[7],P=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|a[0],j=8191&F,Y=F>>>13,V=0|a[1],W=8191&V,X=V>>>13,K=0|a[2],Z=8191&K,H=K>>>13,z=0|a[3],q=8191&z,$=z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,_t=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,j))|0)+((8191&(n=(n=Math.imul(d,Y))+Math.imul(c,j)|0))<<13)|0;h=((o=Math.imul(c,Y))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,Y))+Math.imul(_,j)|0,o=Math.imul(_,Y);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,Y))+Math.imul(m,j)|0,o=Math.imul(m,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,H)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(g,j),n=(n=Math.imul(g,Y))+Math.imul(y,j)|0,o=Math.imul(y,Y),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,H)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(M,j),n=(n=Math.imul(M,Y))+Math.imul(T,j)|0,o=Math.imul(T,Y),i=i+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,H)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0;var gt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(w,j),n=(n=Math.imul(w,Y))+Math.imul(I,j)|0,o=Math.imul(I,Y),i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,H)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,Y))+Math.imul(S,j)|0,o=Math.imul(S,Y),i=i+Math.imul(w,W)|0,n=(n=n+Math.imul(w,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,H)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,H)|0,i=i+Math.imul(g,q)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0;var Nt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(P,j),n=(n=Math.imul(P,Y))+Math.imul(L,j)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(w,Z)|0,n=(n=n+Math.imul(w,H)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,H)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0;var Mt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,Y))+Math.imul(U,j)|0,o=Math.imul(U,Y),i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(w,q)|0,n=(n=n+Math.imul(w,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,Y))+Math.imul(B,j)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,H)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,H)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(w,Q)|0,n=(n=n+Math.imul(w,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(_,dt)|0,o=o+Math.imul(_,ct)|0;var Rt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,_t)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,_t)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,H)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(w,rt)|0,n=(n=n+Math.imul(w,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var wt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,_t)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,_t)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,Z),n=(n=Math.imul(k,H))+Math.imul(B,Z)|0,o=Math.imul(B,H),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(w,ot)|0,n=(n=n+Math.imul(w,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(g,dt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,_t)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,_t)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(w,ut)|0,n=(n=n+Math.imul(w,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var Ot=(h+(i=i+Math.imul(g,pt)|0)|0)+((8191&(n=(n=n+Math.imul(g,_t)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,_t)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(w,dt)|0,n=(n=n+Math.imul(w,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,_t)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,_t)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(w,pt)|0)|0)+((8191&(n=(n=n+Math.imul(w,_t)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,_t)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(P,dt)|0,n=(n=n+Math.imul(P,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,_t)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,_t)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Pt=(h+(i=i+Math.imul(P,pt)|0)|0)+((8191&(n=(n=n+Math.imul(P,_t)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,_t)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,_t)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,_t)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,_t))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,_t))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=At,u[4]=gt,u[5]=yt,u[6]=Nt,u[7]=Mt,u[8]=Tt,u[9]=Rt,u[10]=wt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=St,u[15]=Dt,u[16]=Pt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function _(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):_(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,_=1;0==(r.words[0]&_)&&p<26;++p,_<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function N(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new g;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new N}return E[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var _=f,v=0;0!==_.cmp(a);v++)_=_.redSqr();i(v=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,_,v,E,m,A,g,y,N,M,T,R,w,I,O,b,S,D,P,L,C,x,U,G,k,B,F,j,Y,V,W,X,K,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,R=t[6]<<28|t[7]>>>4,w=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,N=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&A,t[1]=v^~m&g,t[10]=R^~I&b,t[11]=w^~O&S,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~Z&z,t[31]=K^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&y,t[3]=m^~g&N,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~B&j,t[23]=k^~F&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~y&M,t[5]=g^~N&T,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=B^~j&V,t[25]=F^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~M&_,t[7]=N^~T&v,t[16]=D^~L&R,t[17]=P^~C&w,t[26]=j^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~_&E,t[9]=T^~v&m,t[18]=L^~R&I,t[19]=C^~w&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~X&Z,t[39]=tt^~K&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[v>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=v-h,t.block=u[l],v=0;v>2]|=r[3&v],t.lastByteIndex===h)for(u[0]=u[l],v=1;v>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),v=0)}return"0x"+_})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new g(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new g(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new g(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}g.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,_,v,E,m,A,g,y,N,M,T,R,w,I,O,b,S,D,P,L,C,x,U,G,k,B,F,j,Y,V,W,X,K,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,R=t[6]<<28|t[7]>>>4,w=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,N=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&A,t[1]=v^~m&g,t[10]=R^~I&b,t[11]=w^~O&S,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~Z&z,t[31]=K^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&y,t[3]=m^~g&N,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~B&j,t[23]=k^~F&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~y&M,t[5]=g^~N&T,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=B^~j&V,t[25]=F^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~M&_,t[7]=N^~T&v,t[16]=D^~L&R,t[17]=P^~C&w,t[26]=j^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~_&E,t[9]=T^~v&m,t[18]=L^~R&I,t[19]=C^~w&O,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~X&Z,t[39]=tt^~K&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(_=0;_2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},N=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=R.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(_)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function _(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=_,e.getIcapAddress=function(t){for(var e=new n.default.BN(_(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return _("0x"+s.keccak256(a.encode([_(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=_(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),_("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(_(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return _(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function _(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=_},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&_(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},6841:function(t,e,r){"use strict";var i=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);nt)).then((t=>e(null,t))).catch((t=>e(t,null)))}}e.HttpProvider=s},4079:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(3279),e),n(r(6841),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(4079))})(); \ No newline at end of file diff --git a/dist/0xcert-ethereum-metamask-provider.min.js b/dist/0xcert-ethereum-metamask-provider.min.js index 686204f49..bd8d4140e 100644 --- a/dist/0xcert-ethereum-metamask-provider.min.js +++ b/dist/0xcert-ethereum-metamask-provider.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-ethereum-metamask-provider.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var _=h-f|0;l+=(s=(n=0|t.words[_])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var _=this.clone();for(_.negative=0;!_.isZero();){var p=_.modn(f).toString(t);r=(_=_.idivn(f)).isZero()?p+r:l[h-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],_=8191&f,p=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,A=0|s[3],g=8191&A,y=A>>>13,N=0|s[4],M=8191&N,T=N>>>13,w=0|s[5],R=8191&w,I=w>>>13,O=0|s[6],b=8191&O,S=O>>>13,D=0|s[7],P=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],B=8191&G,k=G>>>13,F=0|a[0],Y=8191&F,V=F>>>13,j=0|a[1],W=8191&j,X=j>>>13,K=0|a[2],Z=8191&K,z=K>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],_t=8191&ft,pt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,Y))|0)+((8191&(n=(n=Math.imul(d,V))+Math.imul(c,Y)|0))<<13)|0;h=((o=Math.imul(c,V))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(_,Y),n=(n=Math.imul(_,V))+Math.imul(p,Y)|0,o=Math.imul(p,V);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,Y),n=(n=Math.imul(E,V))+Math.imul(m,Y)|0,o=Math.imul(m,V),i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(p,W)|0,o=o+Math.imul(p,X)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,z)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(g,Y),n=(n=Math.imul(g,V))+Math.imul(y,Y)|0,o=Math.imul(y,V),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(p,Z)|0,o=o+Math.imul(p,z)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(M,Y),n=(n=Math.imul(M,V))+Math.imul(T,Y)|0,o=Math.imul(T,V),i=i+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,z)|0,i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(p,q)|0,o=o+Math.imul(p,$)|0;var gt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(R,Y),n=(n=Math.imul(R,V))+Math.imul(I,Y)|0,o=Math.imul(I,V),i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,z)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,z)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,Y),n=(n=Math.imul(b,V))+Math.imul(S,Y)|0,o=Math.imul(S,V),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,z)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,z)|0,i=i+Math.imul(g,q)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(_,rt)|0,n=(n=n+Math.imul(_,it)|0)+Math.imul(p,rt)|0,o=o+Math.imul(p,it)|0;var Nt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(P,Y),n=(n=Math.imul(P,V))+Math.imul(L,Y)|0,o=Math.imul(L,V),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,z)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,z)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(p,ot)|0,o=o+Math.imul(p,st)|0;var Mt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(x,Y),n=(n=Math.imul(x,V))+Math.imul(U,Y)|0,o=Math.imul(U,V),i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,z)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,z)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(_,ut)|0,n=(n=n+Math.imul(_,ht)|0)+Math.imul(p,ut)|0,o=o+Math.imul(p,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(B,Y),n=(n=Math.imul(B,V))+Math.imul(k,Y)|0,o=Math.imul(k,V),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,z)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(_,dt)|0,n=(n=n+Math.imul(_,ct)|0)+Math.imul(p,dt)|0,o=o+Math.imul(p,ct)|0;var wt=(h+(i=i+Math.imul(d,_t)|0)|0)+((8191&(n=(n=n+Math.imul(d,pt)|0)+Math.imul(c,_t)|0))<<13)|0;h=((o=o+Math.imul(c,pt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(B,W),n=(n=Math.imul(B,X))+Math.imul(k,W)|0,o=Math.imul(k,X),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,z)|0,i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(_,_t)|0)|0)+((8191&(n=(n=n+Math.imul(_,pt)|0)+Math.imul(p,_t)|0))<<13)|0;h=((o=o+Math.imul(p,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(B,Z),n=(n=Math.imul(B,z))+Math.imul(k,Z)|0,o=Math.imul(k,z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(g,dt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var It=(h+(i=i+Math.imul(E,_t)|0)|0)+((8191&(n=(n=n+Math.imul(E,pt)|0)+Math.imul(m,_t)|0))<<13)|0;h=((o=o+Math.imul(m,pt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,$))+Math.imul(k,q)|0,o=Math.imul(k,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var Ot=(h+(i=i+Math.imul(g,_t)|0)|0)+((8191&(n=(n=n+Math.imul(g,pt)|0)+Math.imul(y,_t)|0))<<13)|0;h=((o=o+Math.imul(y,pt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(k,Q)|0,o=Math.imul(k,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(M,_t)|0)|0)+((8191&(n=(n=n+Math.imul(M,pt)|0)+Math.imul(T,_t)|0))<<13)|0;h=((o=o+Math.imul(T,pt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(B,rt),n=(n=Math.imul(B,it))+Math.imul(k,rt)|0,o=Math.imul(k,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(R,_t)|0)|0)+((8191&(n=(n=n+Math.imul(R,pt)|0)+Math.imul(I,_t)|0))<<13)|0;h=((o=o+Math.imul(I,pt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(B,ot),n=(n=Math.imul(B,st))+Math.imul(k,ot)|0,o=Math.imul(k,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(P,dt)|0,n=(n=n+Math.imul(P,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,_t)|0)|0)+((8191&(n=(n=n+Math.imul(b,pt)|0)+Math.imul(S,_t)|0))<<13)|0;h=((o=o+Math.imul(S,pt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(B,ut),n=(n=Math.imul(B,ht))+Math.imul(k,ut)|0,o=Math.imul(k,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Pt=(h+(i=i+Math.imul(P,_t)|0)|0)+((8191&(n=(n=n+Math.imul(P,pt)|0)+Math.imul(L,_t)|0))<<13)|0;h=((o=o+Math.imul(L,pt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(B,dt),n=(n=Math.imul(B,ct))+Math.imul(k,dt)|0,o=Math.imul(k,ct);var Lt=(h+(i=i+Math.imul(x,_t)|0)|0)+((8191&(n=(n=n+Math.imul(x,pt)|0)+Math.imul(U,_t)|0))<<13)|0;h=((o=o+Math.imul(U,pt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(B,_t))|0)+((8191&(n=(n=Math.imul(B,pt))+Math.imul(k,_t)|0))<<13)|0;return h=((o=Math.imul(k,pt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=At,u[4]=gt,u[5]=yt,u[6]=Nt,u[7]=Mt,u[8]=Tt,u[9]=wt,u[10]=Rt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=St,u[15]=Dt,u[16]=Pt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(_=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?_(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var _=0,p=1;0==(r.words[0]&p)&&_<26;++_,p<<=1);if(_>0)for(r.iushrn(_);_-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function N(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new g;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new N}return E[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),_=s;0!==f.cmp(a);){for(var p=f,v=0;0!==p.cmp(a);v++)p=p.redSqr();i(v<_);var E=this.pow(d,new o(1).iushln(_-v-1));c=c.redMul(E),d=E.redSqr(),f=f.redMul(d),_=v}return c},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new g(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new g(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new g(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}g.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,_,p,v,E,m,A,g,y,N,M,T,w,R,I,O,b,S,D,P,L,C,x,U,G,B,k,F,Y,V,j,W,X,K,Z,z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(_=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|_>>>31),r=l^(_<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,j=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,B=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,k=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,N=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,Y=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=p^~E&A,t[1]=v^~m&g,t[10]=w^~I&b,t[11]=R^~O&S,t[20]=x^~G&k,t[21]=U^~B&F,t[30]=X^~Z&H,t[31]=K^~z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&y,t[3]=m^~g&N,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~k&Y,t[23]=B^~F&V,t[32]=Z^~H&$,t[33]=z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~y&M,t[5]=g^~N&T,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=k^~Y&j,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~M&p,t[7]=N^~T&v,t[16]=D^~L&w,t[17]=P^~C&R,t[26]=Y^~j&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~p&E,t[9]=T^~v&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=j^~x&G,t[29]=W^~U&B,t[38]=Q^~X&Z,t[39]=tt^~K&z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(p=0;p<_.length;++p)e[_[p]]=f[_[p]]}()},861:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(3850),a=o(r(6666)),u=r(2990),h=r(2069),l=r(2453),d=r(9469),c=r(589),f=new RegExp(/^bytes([0-9]*)$/),_=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(_);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),E=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function A(t,e){var r=t;function i(t){throw new Error('unexpected character "'+r[t]+'" at position '+t+' in "'+r+'"')}t=t.replace(/\s/g," ");for(var n={type:"",name:"",state:{allowType:!0}},o=n,s=0;s2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(B(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");B(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},N=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(p)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var Y=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=Y,e.defaultAbiCoder=new Y},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function _(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function p(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==_(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=p,e.getIcapAddress=function(t){for(var e=new n.default.BN(p(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+_("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return p("0x"+s.keccak256(a.encode([p(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=p(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),p("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(p(t))}function c(t){return new _(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var _=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return p(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function p(t){return _.isBigNumber(t)?t:new _(t)}e.BigNumber=_,e.bigNumberify=p},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function _(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=_,e.joinSignature=function(t){return c(h([(t=_(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}p(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&p(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=_(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},516:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MetamaskProvider=void 0;const n=r(3279);class o extends n.GenericProvider{constructor(t){super(Object.assign(Object.assign({},t),{signMethod:n.SignMethod.PERSONAL_SIGN})),this.isSupported()&&(this.installClient(),this.installEvents())}static getInstance(){return new this}isSupported(){return"undefined"!=typeof window&&(void 0!==window.ethereum?window.ethereum.isMetaMask:void 0!==window.web3&&void 0!==window.web3.currentProvider&&window.web3.currentProvider.isMetaMask)}isEnabled(){return i(this,void 0,void 0,(function*(){return!(!this.isSupported()||!this.accountId||void 0===window.ethereum&&void 0===window.web3)}))}enable(){return i(this,void 0,void 0,(function*(){if(!this.isSupported())return!1;if(void 0!==window.ethereum){const t=yield this.requestAccounts();if(!(t&&t.length>0))return!1;this.accountId=t[0]}else this.accountId=window.web3.eth.coinbase;return!0}))}requestAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_requestAccounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}installClient(){return i(this,void 0,void 0,(function*(){void 0!==window.ethereum?this._client=window.ethereum:this._client=Object.assign(Object.assign({},window.web3.currentProvider),{send(t,e){-1!==["eth_accounts","eth_coinbase","net_version"].indexOf(t.method)?e(null,window.web3.currentProvider.send(t)):window.web3.currentProvider.sendAsync(t,e)}})}))}installEvents(){return i(this,void 0,void 0,(function*(){const t=yield this.getNetworkVersion();t!==this._networkVersion&&(this.emit(n.ProviderEvent.NETWORK_CHANGE,t,this._networkVersion),this._networkVersion=t),this.accountId=yield this.getAvailableAccounts().then((t=>t[0])),setTimeout((()=>this.installEvents()),1e3)}))}}e.MetamaskProvider=o},9386:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(3279),e),n(r(516),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9386))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var _=h-f|0;l+=(s=(n=0|t.words[_])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var _=this.clone();for(_.negative=0;!_.isZero();){var p=_.modn(f).toString(t);r=(_=_.idivn(f)).isZero()?p+r:l[h-p.length]+p+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],_=8191&f,p=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,A=0|s[3],g=8191&A,y=A>>>13,N=0|s[4],M=8191&N,T=N>>>13,w=0|s[5],R=8191&w,I=w>>>13,O=0|s[6],b=8191&O,S=O>>>13,D=0|s[7],P=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],B=8191&G,k=G>>>13,F=0|a[0],Y=8191&F,V=F>>>13,j=0|a[1],W=8191&j,X=j>>>13,K=0|a[2],Z=8191&K,z=K>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],_t=8191&ft,pt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,Y))|0)+((8191&(n=(n=Math.imul(d,V))+Math.imul(c,Y)|0))<<13)|0;h=((o=Math.imul(c,V))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(_,Y),n=(n=Math.imul(_,V))+Math.imul(p,Y)|0,o=Math.imul(p,V);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,Y),n=(n=Math.imul(E,V))+Math.imul(m,Y)|0,o=Math.imul(m,V),i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(p,W)|0,o=o+Math.imul(p,X)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,z)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(g,Y),n=(n=Math.imul(g,V))+Math.imul(y,Y)|0,o=Math.imul(y,V),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(_,Z)|0,n=(n=n+Math.imul(_,z)|0)+Math.imul(p,Z)|0,o=o+Math.imul(p,z)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(M,Y),n=(n=Math.imul(M,V))+Math.imul(T,Y)|0,o=Math.imul(T,V),i=i+Math.imul(g,W)|0,n=(n=n+Math.imul(g,X)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,X)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,z)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,z)|0,i=i+Math.imul(_,q)|0,n=(n=n+Math.imul(_,$)|0)+Math.imul(p,q)|0,o=o+Math.imul(p,$)|0;var gt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(R,Y),n=(n=Math.imul(R,V))+Math.imul(I,Y)|0,o=Math.imul(I,V),i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,i=i+Math.imul(g,Z)|0,n=(n=n+Math.imul(g,z)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,z)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(_,Q)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(p,Q)|0,o=o+Math.imul(p,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,Y),n=(n=Math.imul(b,V))+Math.imul(S,Y)|0,o=Math.imul(S,V),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(M,Z)|0,n=(n=n+Math.imul(M,z)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,z)|0,i=i+Math.imul(g,q)|0,n=(n=n+Math.imul(g,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(_,rt)|0,n=(n=n+Math.imul(_,it)|0)+Math.imul(p,rt)|0,o=o+Math.imul(p,it)|0;var Nt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(P,Y),n=(n=Math.imul(P,V))+Math.imul(L,Y)|0,o=Math.imul(L,V),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,z)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,z)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(g,Q)|0,n=(n=n+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(_,ot)|0,n=(n=n+Math.imul(_,st)|0)+Math.imul(p,ot)|0,o=o+Math.imul(p,st)|0;var Mt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(x,Y),n=(n=Math.imul(x,V))+Math.imul(U,Y)|0,o=Math.imul(U,V),i=i+Math.imul(P,W)|0,n=(n=n+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,z)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,z)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(g,rt)|0,n=(n=n+Math.imul(g,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(_,ut)|0,n=(n=n+Math.imul(_,ht)|0)+Math.imul(p,ut)|0,o=o+Math.imul(p,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(B,Y),n=(n=Math.imul(B,V))+Math.imul(k,Y)|0,o=Math.imul(k,V),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(P,Z)|0,n=(n=n+Math.imul(P,z)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(g,ot)|0,n=(n=n+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(_,dt)|0,n=(n=n+Math.imul(_,ct)|0)+Math.imul(p,dt)|0,o=o+Math.imul(p,ct)|0;var wt=(h+(i=i+Math.imul(d,_t)|0)|0)+((8191&(n=(n=n+Math.imul(d,pt)|0)+Math.imul(c,_t)|0))<<13)|0;h=((o=o+Math.imul(c,pt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(B,W),n=(n=Math.imul(B,X))+Math.imul(k,W)|0,o=Math.imul(k,X),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,z)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,z)|0,i=i+Math.imul(P,q)|0,n=(n=n+Math.imul(P,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(g,ut)|0,n=(n=n+Math.imul(g,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(_,_t)|0)|0)+((8191&(n=(n=n+Math.imul(_,pt)|0)+Math.imul(p,_t)|0))<<13)|0;h=((o=o+Math.imul(p,pt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(B,Z),n=(n=Math.imul(B,z))+Math.imul(k,Z)|0,o=Math.imul(k,z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(P,Q)|0,n=(n=n+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(g,dt)|0,n=(n=n+Math.imul(g,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var It=(h+(i=i+Math.imul(E,_t)|0)|0)+((8191&(n=(n=n+Math.imul(E,pt)|0)+Math.imul(m,_t)|0))<<13)|0;h=((o=o+Math.imul(m,pt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(B,q),n=(n=Math.imul(B,$))+Math.imul(k,q)|0,o=Math.imul(k,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(P,rt)|0,n=(n=n+Math.imul(P,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var Ot=(h+(i=i+Math.imul(g,_t)|0)|0)+((8191&(n=(n=n+Math.imul(g,pt)|0)+Math.imul(y,_t)|0))<<13)|0;h=((o=o+Math.imul(y,pt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(B,Q),n=(n=Math.imul(B,tt))+Math.imul(k,Q)|0,o=Math.imul(k,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(P,ot)|0,n=(n=n+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(M,_t)|0)|0)+((8191&(n=(n=n+Math.imul(M,pt)|0)+Math.imul(T,_t)|0))<<13)|0;h=((o=o+Math.imul(T,pt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(B,rt),n=(n=Math.imul(B,it))+Math.imul(k,rt)|0,o=Math.imul(k,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(P,ut)|0,n=(n=n+Math.imul(P,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(R,_t)|0)|0)+((8191&(n=(n=n+Math.imul(R,pt)|0)+Math.imul(I,_t)|0))<<13)|0;h=((o=o+Math.imul(I,pt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(B,ot),n=(n=Math.imul(B,st))+Math.imul(k,ot)|0,o=Math.imul(k,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(P,dt)|0,n=(n=n+Math.imul(P,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,_t)|0)|0)+((8191&(n=(n=n+Math.imul(b,pt)|0)+Math.imul(S,_t)|0))<<13)|0;h=((o=o+Math.imul(S,pt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(B,ut),n=(n=Math.imul(B,ht))+Math.imul(k,ut)|0,o=Math.imul(k,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Pt=(h+(i=i+Math.imul(P,_t)|0)|0)+((8191&(n=(n=n+Math.imul(P,pt)|0)+Math.imul(L,_t)|0))<<13)|0;h=((o=o+Math.imul(L,pt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(B,dt),n=(n=Math.imul(B,ct))+Math.imul(k,dt)|0,o=Math.imul(k,ct);var Lt=(h+(i=i+Math.imul(x,_t)|0)|0)+((8191&(n=(n=n+Math.imul(x,pt)|0)+Math.imul(U,_t)|0))<<13)|0;h=((o=o+Math.imul(U,pt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(B,_t))|0)+((8191&(n=(n=Math.imul(B,pt))+Math.imul(k,_t)|0))<<13)|0;return h=((o=Math.imul(k,pt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=At,u[4]=gt,u[5]=yt,u[6]=Nt,u[7]=Mt,u[8]=Tt,u[9]=wt,u[10]=Rt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=St,u[15]=Dt,u[16]=Pt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function p(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(_=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?_(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):p(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var _=0,p=1;0==(r.words[0]&p)&&_<26;++_,p<<=1);if(_>0)for(r.iushrn(_);_-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function N(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new g;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new N}return E[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),_=s;0!==f.cmp(a);){for(var p=f,v=0;0!==p.cmp(a);v++)p=p.redSqr();i(v<_);var E=this.pow(d,new o(1).iushln(_-v-1));c=c.redMul(E),d=E.redSqr(),f=f.redMul(d),_=v}return c},M.prototype.invm=function(t){var e=t._invmp(this.m);return 0!==e.negative?(e.negative=0,this.imod(e).redNeg()):this.imod(e)},M.prototype.pow=function(t,e){if(e.isZero())return new o(1).toRed(this);if(0===e.cmpn(1))return t.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=t;for(var i=2;i=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,M),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new g(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new g(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new g(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}g.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,_,p,v,E,m,A,g,y,N,M,T,w,R,I,O,b,S,D,P,L,C,x,U,G,B,k,F,Y,V,j,W,X,K,Z,z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(_=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|_>>>31),r=l^(_<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,p=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,j=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,P=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,B=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,g=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,k=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,N=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,Y=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=p^~E&A,t[1]=v^~m&g,t[10]=w^~I&b,t[11]=R^~O&S,t[20]=x^~G&k,t[21]=U^~B&F,t[30]=X^~Z&H,t[31]=K^~z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&y,t[3]=m^~g&N,t[12]=I^~b&D,t[13]=O^~S&P,t[22]=G^~k&Y,t[23]=B^~F&V,t[32]=Z^~H&$,t[33]=z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~y&M,t[5]=g^~N&T,t[14]=b^~D&L,t[15]=S^~P&C,t[24]=k^~Y&j,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~M&p,t[7]=N^~T&v,t[16]=D^~L&w,t[17]=P^~C&R,t[26]=Y^~j&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~p&E,t[9]=T^~v&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=j^~x&G,t[29]=W^~U&B,t[38]=Q^~X&Z,t[39]=tt^~K&z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(p=0;p<_.length;++p)e[_[p]]=f[_[p]]}()},861:function(t,e,r){"use strict";var i,n=this&&this.__extends||(i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])},function(t,e){function r(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var s=r(3850),a=o(r(6666)),u=r(2990),h=r(2069),l=r(2453),d=r(9469),c=r(589),f=new RegExp(/^bytes([0-9]*)$/),_=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(_);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),E=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function m(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function A(t,e){var r=t;function i(t){throw new Error('unexpected character "'+r[t]+'" at position '+t+' in "'+r+'"')}t=t.replace(/\s/g," ");for(var n={type:"",name:"",state:{allowType:!0}},o=n,s=0;s2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(B(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");B(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},N=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(p)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var Y=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=Y,e.defaultAbiCoder=new Y},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function _(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function p(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==_(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=p,e.getIcapAddress=function(t){for(var e=new n.default.BN(p(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+_("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return p("0x"+s.keccak256(a.encode([p(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=p(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),p("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(p(t))}function c(t){return new _(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var _=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return p(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function p(t){return _.isBigNumber(t)?t:new _(t)}e.BigNumber=_,e.bigNumberify=p},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function _(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=_,e.joinSignature=function(t){return c(h([(t=_(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}p(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&p(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=_(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},516:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.MetamaskProvider=void 0;const n=r(3279);class o extends n.GenericProvider{constructor(t){super(Object.assign(Object.assign({},t),{signMethod:n.SignMethod.PERSONAL_SIGN})),this.isSupported()&&(this.installClient(),this.installEvents())}static getInstance(){return new this}isSupported(){return"undefined"!=typeof window&&(void 0!==window.ethereum?window.ethereum.isMetaMask:void 0!==window.web3&&void 0!==window.web3.currentProvider&&window.web3.currentProvider.isMetaMask)}isEnabled(){return i(this,void 0,void 0,(function*(){return!(!this.isSupported()||!this.accountId||void 0===window.ethereum&&void 0===window.web3)}))}enable(){return i(this,void 0,void 0,(function*(){if(!this.isSupported())return!1;if(void 0!==window.ethereum){const t=yield this.requestAccounts();if(!(t&&t.length>0))return!1;this.accountId=t[0]}else this.accountId=window.web3.eth.coinbase;return!0}))}requestAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_requestAccounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}installClient(){return i(this,void 0,void 0,(function*(){void 0!==window.ethereum?this._client=window.ethereum:this._client=Object.assign(Object.assign({},window.web3.currentProvider),{send(t,e){-1!==["eth_accounts","eth_coinbase","net_version"].indexOf(t.method)?e(null,window.web3.currentProvider.send(t)):window.web3.currentProvider.sendAsync(t,e)}})}))}installEvents(){return i(this,void 0,void 0,(function*(){const t=yield this.getNetworkVersion();t!==this._networkVersion&&(this.emit(n.ProviderEvent.NETWORK_CHANGE,t,this._networkVersion),this._networkVersion=t),this.accountId=yield this.getAvailableAccounts().then((t=>t[0])),setTimeout((()=>this.installEvents()),1e3)}))}}e.MetamaskProvider=o},9386:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(3279),e),n(r(516),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9386))})(); \ No newline at end of file diff --git a/dist/0xcert-ethereum-value-ledger.min.js b/dist/0xcert-ethereum-value-ledger.min.js index 59f8f4b8d..4b97648ec 100644 --- a/dist/0xcert-ethereum-value-ledger.min.js +++ b/dist/0xcert-ethereum-value-ledger.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-ethereum-value-ledger.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:l[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,A=0|s[3],y=8191&A,g=A>>>13,T=0|s[4],M=8191&T,N=T>>>13,w=0|s[5],R=8191&w,I=w>>>13,O=0|s[6],b=8191&O,P=O>>>13,D=0|s[7],S=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|a[0],j=8191&F,V=F>>>13,Y=0|a[1],W=8191&Y,X=Y>>>13,K=0|a[2],z=8191&K,Z=K>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(h+(i=Math.imul(d,j))|0)+((8191&(n=(n=Math.imul(d,V))+Math.imul(c,j)|0))<<13)|0;h=((o=Math.imul(c,V))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,V))+Math.imul(v,j)|0,o=Math.imul(v,V);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,V))+Math.imul(m,j)|0,o=Math.imul(m,V),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,X)|0;var mt=(h+(i=i+Math.imul(d,z)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(c,z)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(y,j),n=(n=Math.imul(y,V))+Math.imul(g,j)|0,o=Math.imul(g,V),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(M,j),n=(n=Math.imul(M,V))+Math.imul(N,j)|0,o=Math.imul(N,V),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var yt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(R,j),n=(n=Math.imul(R,V))+Math.imul(I,j)|0,o=Math.imul(I,V),i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(y,z)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,V))+Math.imul(P,j)|0,o=Math.imul(P,V),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(M,z)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,Z)|0,i=i+Math.imul(y,q)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var Tt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(S,j),n=(n=Math.imul(S,V))+Math.imul(L,j)|0,o=Math.imul(L,V),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(R,z)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Mt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,V))+Math.imul(U,j)|0,o=Math.imul(U,V),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var Nt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,V))+Math.imul(B,j)|0,o=Math.imul(B,V),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,vt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,vt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,i=i+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(y,dt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(g,dt)|0,o=o+Math.imul(g,ct)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,vt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,ct)|0;var Ot=(h+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(P,dt)|0,o=o+Math.imul(P,ct)|0;var Pt=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(S,dt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var St=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=Et,u[2]=mt,u[3]=At,u[4]=yt,u[5]=gt,u[6]=Tt,u[7]=Mt,u[8]=Nt,u[9]=wt,u[10]=Rt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=Dt,u[16]=St,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function N(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new y;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new T}return E[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new N(t)},n(N,M),N.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},N.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},N.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},N.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,T,M,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,T=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&T,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&M,t[5]=y^~T&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~M&v,t[7]=T^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=_-h,t.block=u[l],_=0;_>2]|=r[3&_],t.lastByteIndex===h)for(u[0]=u[l],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new y(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new y(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new y(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}y.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},y.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,T,M,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,T=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&T,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&M,t[5]=y^~T&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~M&v,t[7]=T^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},T=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),N=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new N(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(v(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8218:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedger=void 0;const n=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),h=r(6512),l=r(7061),d=r(3919),c=r(8926),f=r(2328);e.ValueLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),d.default(this,t,e)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t)}))}getInfo(){return i(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(t,e,r){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const i=yield d.default(this,e,r);return o.bigNumberify(i).gte(o.bigNumberify(t))}))}approveValue(t,e){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!o.bigNumberify(t).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,e,t)}))}disapproveValue(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),a.default(this,t,"0")}))}transferValue(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?l.default(this,e,r,t.value):h.default(this,r,t.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8218),e)},646:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1225:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:a,supply:u}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.valueLedgerSource)).TokenMock.evm.bytecode.object,h={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(s,[e,r,a,u]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[h]});return new n.Mutation(t,l.result)}))}},7061:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},6512:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa9059cbb"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3919:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xdd62ed3e"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},8926:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},2328:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}}))}},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5508))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:l[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,A=0|s[3],y=8191&A,g=A>>>13,T=0|s[4],M=8191&T,N=T>>>13,w=0|s[5],R=8191&w,I=w>>>13,O=0|s[6],b=8191&O,P=O>>>13,D=0|s[7],S=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|a[0],j=8191&F,V=F>>>13,Y=0|a[1],W=8191&Y,X=Y>>>13,K=0|a[2],z=8191&K,Z=K>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(h+(i=Math.imul(d,j))|0)+((8191&(n=(n=Math.imul(d,V))+Math.imul(c,j)|0))<<13)|0;h=((o=Math.imul(c,V))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,V))+Math.imul(v,j)|0,o=Math.imul(v,V);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,V))+Math.imul(m,j)|0,o=Math.imul(m,V),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,X)|0;var mt=(h+(i=i+Math.imul(d,z)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(c,z)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(y,j),n=(n=Math.imul(y,V))+Math.imul(g,j)|0,o=Math.imul(g,V),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(M,j),n=(n=Math.imul(M,V))+Math.imul(N,j)|0,o=Math.imul(N,V),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var yt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(R,j),n=(n=Math.imul(R,V))+Math.imul(I,j)|0,o=Math.imul(I,V),i=i+Math.imul(M,W)|0,n=(n=n+Math.imul(M,X)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(y,z)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,V))+Math.imul(P,j)|0,o=Math.imul(P,V),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(M,z)|0,n=(n=n+Math.imul(M,Z)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,Z)|0,i=i+Math.imul(y,q)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var Tt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(S,j),n=(n=Math.imul(S,V))+Math.imul(L,j)|0,o=Math.imul(L,V),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(R,z)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(M,q)|0,n=(n=n+Math.imul(M,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Mt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,V))+Math.imul(U,j)|0,o=Math.imul(U,V),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(M,Q)|0,n=(n=n+Math.imul(M,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var Nt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,V))+Math.imul(B,j)|0,o=Math.imul(B,V),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(M,rt)|0,n=(n=n+Math.imul(M,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,vt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,vt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(M,ot)|0,n=(n=n+Math.imul(M,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,i=i+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(M,ut)|0,n=(n=n+Math.imul(M,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(y,dt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(g,dt)|0,o=o+Math.imul(g,ct)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,vt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(M,dt)|0,n=(n=n+Math.imul(M,ct)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,ct)|0;var Ot=(h+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(M,pt)|0)|0)+((8191&(n=(n=n+Math.imul(M,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(P,dt)|0,o=o+Math.imul(P,ct)|0;var Pt=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(S,dt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var St=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=Et,u[2]=mt,u[3]=At,u[4]=yt,u[5]=gt,u[6]=Tt,u[7]=Mt,u[8]=Nt,u[9]=wt,u[10]=Rt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=Dt,u[16]=St,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e),r},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new M(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function M(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function N(t){M.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new y;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new T}return E[t]=e,e},M.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},M.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},M.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},M.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},M.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},M.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},M.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},M.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},M.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},M.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},M.prototype.isqr=function(t){return this.imul(t,t.clone())},M.prototype.sqr=function(t){return this.mul(t,t)},M.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},M.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},M.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new N(t)},n(N,M),N.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},N.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},N.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},N.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,T,M,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,T=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&T,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&M,t[5]=y^~T&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~M&v,t[7]=T^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=_-h,t.block=u[l],_=0;_>2]|=r[3&_],t.lastByteIndex===h)for(u[0]=u[l],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new y(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new y(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new y(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}y.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},y.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,T,M,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,T=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,M=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&T,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&M,t[5]=y^~T&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~M&v,t[7]=T^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=M^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},T=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),N=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new N(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(v(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8218:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedger=void 0;const n=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),h=r(6512),l=r(7061),d=r(3919),c=r(8926),f=r(2328);e.ValueLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),d.default(this,t,e)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t)}))}getInfo(){return i(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(t,e,r){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const i=yield d.default(this,e,r);return o.bigNumberify(i).gte(o.bigNumberify(t))}))}approveValue(t,e){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!o.bigNumberify(t).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,e,t)}))}disapproveValue(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),a.default(this,t,"0")}))}transferValue(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?l.default(this,e,r,t.value):h.default(this,r,t.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8218),e)},646:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1225:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:a,supply:u}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.valueLedgerSource)).TokenMock.evm.bytecode.object,h={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(s,[e,r,a,u]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[h]});return new n.Mutation(t,l.result)}))}},7061:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},6512:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa9059cbb"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3919:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xdd62ed3e"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},8926:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},2328:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}}))}},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5508))})(); \ No newline at end of file diff --git a/dist/0xcert-ethereum.min.js b/dist/0xcert-ethereum.min.js index 515721a1e..89802d159 100644 --- a/dist/0xcert-ethereum.min.js +++ b/dist/0xcert-ethereum.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-ethereum.min.js.LICENSE.txt */ -(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],g=8191&y,A=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,w=0|s[5],b=8191&w,R=w>>>13,N=0|s[6],M=8191&N,P=N>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,G=0|s[9],j=8191&G,U=G>>>13,F=0|a[0],B=8191&F,K=F>>>13,V=0|a[1],Y=8191&V,z=V>>>13,X=0|a[2],H=8191&X,W=X>>>13,$=0|a[3],Z=8191&$,q=$>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,B))|0)+((8191&(i=(i=Math.imul(h,K))+Math.imul(l,B)|0))<<13)|0;d=((o=Math.imul(l,K))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,K))+Math.imul(v,B)|0,o=Math.imul(v,K);var me=(d+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,B),i=(i=Math.imul(m,K))+Math.imul(E,B)|0,o=Math.imul(E,K),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,z)|0;var Ee=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(g,B),i=(i=Math.imul(g,K))+Math.imul(A,B)|0,o=Math.imul(A,K),n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,Z)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,B),i=(i=Math.imul(I,K))+Math.imul(T,B)|0,o=Math.imul(T,K),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,q)|0;var ge=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(b,B),i=(i=Math.imul(b,K))+Math.imul(R,B)|0,o=Math.imul(R,K),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var Ae=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,K))+Math.imul(P,B)|0,o=Math.imul(P,K),n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,B),i=(i=Math.imul(D,K))+Math.imul(x,B)|0,o=Math.imul(x,K),n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,K))+Math.imul(k,B)|0,o=Math.imul(k,K),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,K))+Math.imul(U,B)|0,o=Math.imul(U,K),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var we=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,z))+Math.imul(U,Y)|0,o=Math.imul(U,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,de)|0,n=n+Math.imul(m,he)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,le)|0;var be=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,W))+Math.imul(U,H)|0,o=Math.imul(U,W),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Re=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ve)|0)+Math.imul(E,pe)|0))<<13)|0;d=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,q))+Math.imul(U,Z)|0,o=Math.imul(U,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var Ne=(d+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(A,pe)|0))<<13)|0;d=((o=o+Math.imul(A,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,de)|0,n=n+Math.imul(b,he)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Me=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(d+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(R,pe)|0))<<13)|0;d=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,oe),i=(i=Math.imul(j,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;d=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,ue),i=(i=Math.imul(j,de))+Math.imul(U,ue)|0,o=Math.imul(U,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(j,he),i=(i=Math.imul(j,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(U,pe)|0))<<13)|0;return d=((o=Math.imul(U,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=me,u[2]=Ee,u[3]=ye,u[4]=ge,u[5]=Ae,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=we,u[10]=be,u[11]=Re,u[12]=Ne,u[13]=Me,u[14]=Pe,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(y,E),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return m[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,w,b,R,N,M,P,S,D,x,L,C,k,G,j,U,F,B,K,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,w=e[6]<<28|e[7]>>>4,b=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=w^~R&M,e[11]=b^~N&P,e[20]=C^~G&U,e[21]=k^~j&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~M&S,e[13]=N^~P&D,e[22]=G^~U&B,e[23]=j^~F&K,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=U^~B&V,e[25]=F^~K&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&w,e[17]=D^~L&b,e[26]=B^~V&C,e[27]=K^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~w&R,e[19]=L^~b&N,e[28]=V^~C&G,e[29]=Y^~k&j,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];m%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new g(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new g(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new g(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}g.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(A(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&A(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,w,b,R,N,M,P,S,D,x,L,C,k,G,j,U,F,B,K,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,w=e[6]<<28|e[7]>>>4,b=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=w^~R&M,e[11]=b^~N&P,e[20]=C^~G&U,e[21]=k^~j&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~M&S,e[13]=N^~P&D,e[22]=G^~U&B,e[23]=j^~F&K,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=U^~B&V,e[25]=F^~K&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&w,e[17]=D^~L&b,e[26]=B^~V&C,e[27]=K^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~w&R,e[19]=L^~b&N,e[28]=V^~C&G,e[29]=Y^~k&j,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(m))throw new Error('invalid identifier: "'+n[1]+'"');if(j(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");j(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var A=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(A),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(A),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=w.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new R(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new G(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var B=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new G(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new G(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=B,t.defaultAbiCoder=new B},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},5736:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Cert=void 0;const i=r(2461),o=r(5353),s=r(7077);class a{constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>n(this,void 0,void 0,(function*(){return o.sha(256,s.toString(e))})),noncer:e=>n(this,void 0,void 0,(function*(){return o.sha(256,e.join("."))}))},e))}static getInstance(e){return new a(e)}identify(e){return n(this,void 0,void 0,(function*(){return o.sha(256,JSON.stringify(!1!==e?this.sortSchema(this.schema):this.schema))}))}notarize(e){return n(this,void 0,void 0,(function*(){const t=this.buildSchemaProps(e),r=yield this.buildCompoundProps(t);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(r)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}expose(e,t){const r={};return t.forEach((t=>{const n=s.readPath(t,e);s.writePath(t,n,r)})),JSON.parse(JSON.stringify(r))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=this.buildSchemaProps(e),n=yield this.buildCompoundProps(r);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(n,t)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}calculate(e,t){return n(this,void 0,void 0,(function*(){try{return this.checkDataInclusion(e,t.data)?this.imprintRecipes(t.data):null}catch(e){return null}}))}imprint(e){return n(this,void 0,void 0,(function*(){return this.notarize(e).then((e=>e.data[0].nodes[0].hash)).catch((()=>null))}))}buildSchemaProps(e,t=this.schema,r=[]){if("array"===t.type){const n=(e||[]).map(((e,n)=>this.buildSchemaProps(e,t.items,[...r,n]))).reduce(((e,t)=>e.concat(t)),[]);return n.length>0?n:[this.buildSchemaProps(void 0,{},[...r])]}return"object"===t.type?Object.keys(t.properties).sort().map((n=>{const i=this.buildSchemaProps((e||{})[n],t.properties[n],[...r,n]);return-1===["object","array"].indexOf(t.properties[n].type)?[i]:i})).reduce(((e,t)=>e.concat(t)),[]):{path:r,value:e,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(e){return n(this,void 0,void 0,(function*(){e=[...e];const t=this.buildPropGroups(e),r=Object.keys(t).sort(((e,t)=>e>t?-1:1)).filter((e=>""!==e));for(const n of r){const r=t[n],i=[...e.filter((e=>e.group===n))].sort(((e,t)=>e.key>t.key?1:-1)).map((e=>e.value)),o=yield this.merkle.notarize(i,r);e.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return e.sort(((e,t)=>e.key>t.key?1:-1))}))}buildRecipes(e,t=null){return n(this,void 0,void 0,(function*(){const r=t?s.stepPaths(t).map((e=>e.join("."))):null,i={};return e.forEach((e=>i[e.group]=e.path.slice(0,-1))),Promise.all(Object.keys(i).map((t=>n(this,void 0,void 0,(function*(){const n=e.filter((e=>e.group===t)).map((e=>e.value));let o=yield this.merkle.notarize(n,i[t]);if(r){const n=e.filter((e=>e.group===t)).map(((e,t)=>-1===r.indexOf(e.key)?-1:t)).filter((e=>-1!==e));o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[t].join(".")))return{path:i[t],values:o.values,nodes:o.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))))).then((e=>e.filter((e=>!!e))))}))}checkDataInclusion(e,t){const r=this.buildSchemaProps(e);t=s.cloneObject(t).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e)));for(const n of r){const r=s.readPath(n.path,e);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=t.find((e=>e.key===i));if(!o)return!1;const a=this.getPathIndexes(n.path).pop(),u=o.values.find((e=>e.index===a));if(void 0!==u&&u.value!==r)return!1}return!0}imprintRecipes(e){return n(this,void 0,void 0,(function*(){if(0===e.length)return this.getEmptyImprint();e=s.cloneObject(e).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e))).sort(((e,t)=>e.path.length>t.path.length?-1:1));for(const t of e){const r=yield this.merkle.imprint(t).catch((()=>""));t.nodes.unshift({index:0,hash:r});const n=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),o=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find((e=>e.key===n));s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const t=e.find((e=>""===e.key));return t?t.nodes.find((e=>0===e.index)).hash:this.getEmptyImprint()}))}getPathIndexes(e){const t=[];let r=this.schema;for(const n of e)"array"===r.type?(t.push(n),r=r.items):"object"===r.type?(t.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):t.push(void 0);return t}getEmptyImprint(){return n(this,void 0,void 0,(function*(){return this.merkle.notarize([]).then((e=>e.nodes[0].hash))}))}buildPropGroups(e){const t={};return e.map((e=>{const t=[];return e.path.map((e=>(t.push(e),[...t])))})).reduce(((e,t)=>e.concat(t)),[]).forEach((e=>t[e.slice(0,-1).join(".")]=e.slice(0,-1))),t}sortSchema(e){return Object.keys(e).sort().reduce(((t,r)=>(Array.isArray(e[r])?t[r]=e[r].sort():"object"==typeof e[r]?t[r]=this.sortSchema(e[r]):t[r]=e[r],t)),{})}}t.Cert=a},3377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9230:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5736),t),i(r(3377),t)},7077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writePath=t.readPath=t.stepPaths=t.cloneObject=t.toString=void 0,t.toString=function(e){try{return null==e?"":`${e}`}catch(e){return""}},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.stepPaths=function(e){const t={"":[]};return e.forEach((e=>{const r=[];e.forEach((e=>{r.push(e),t[r.join(".")]=[...r]}))})),Object.keys(t).sort().map((e=>t[e]))},t.readPath=function e(t,r){try{return Array.isArray(t)?0===t.length?r:e(t.slice(1),r[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,r={}){let n=r=r||{};for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),m=r(8634),E=r(7045),y=r(5636),g=r(6075),A=r(8608),O=r(1785),I=r(7461),T=r(2746),w=r(3924),b=r(5434),R=r(6651),N=r(8453),M=r(9085),P=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),G=r(1399),j=r(9156),U=r(3022),F=r(9669),B=r(7734),K=r(4909),V=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?N.default(this,e):R.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):U.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),m.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),E.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=V.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case V.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=V.ProxyId.NFTOKEN_TRANSFER);break;case V.ProxyKind.CREATE_ASSET:t=V.ProxyId.XCERT_CREATE;break;case V.ProxyKind.DESTROY_ASSET:t=V.ProxyId.XCERT_BURN;break;case V.ProxyKind.MANAGE_ABILITIES:t=V.ProxyId.MANAGE_ABILITIES;break;case V.ProxyKind.TRANSFER_TOKEN:t=V.ProxyId.TOKEN_TRANSFER;break;case V.ProxyKind.UPDATE_ASSET:t=V.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return w.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),b.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),b.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),j.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8218:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),d=r(6512),c=r(7061),h=r(3919),l=r(8926),f=r(2328);t.ValueLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),h.default(this,e,t)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),l.default(this,e)}))}getInfo(){return n(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(e,t,r){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,t,r);return o.bigNumberify(n).gte(o.bigNumberify(e))}))}approveValue(e,t){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t);const r=yield this.getApprovedValue(this.provider.accountId,t);if(!o.bigNumberify(e).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,t,e)}))}disapproveValue(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),a.default(this,e,"0")}))}transferValue(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return e.senderId?c.default(this,t,r,e.value):d.default(this,r,e.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8218),t)},646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=["string","string","uint8","uint256"];t.default=function(e,{name:t,symbol:r,decimals:a,supply:u}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.valueLedgerSource)).TokenMock.evm.bytecode.object,d={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(s,[t,r,a,u]).substr(2)}`},c=yield e.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e,c.result)}))}},7061:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},6512:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa9059cbb"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3919:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xdd62ed3e"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},8926:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},2328:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],decimals:t[2],supply:t[3]}}))}},5836:function(e,t){"use strict";var r,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Merkle=t.MerkleHasherPosition=void 0,function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(r=t.MerkleHasherPosition||(t.MerkleHasherPosition={})),t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,r){return this._options.hasher(e,t,r)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return n(this,void 0,void 0,(function*(){const n=[...e],i=[],o=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(o,[...t,n.length],r.NODE)];for(let e=n.length-1;e>=0;e--){const o=s[0];i.unshift(yield this._options.noncer([...t,e]));const a=yield this._options.hasher(n[e],[...t,e],r.VALUE);s.unshift(yield this._options.hasher(`${a}${i[0]}`,[...t,e],r.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${o}`,[...t,e],r.NODE))}return{values:n.map(((e,t)=>({index:t,value:e,nonce:i[t]}))),nodes:s.map(((e,t)=>({index:t,hash:e})))}}))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=Math.max(...t.map((e=>e+1)),0),n=[],i=[e.nodes.find((e=>e.index===2*r))];for(let o=r-1;o>=0;o--)-1!==t.indexOf(o)?n.unshift(e.values.find((e=>e.index===o))):i.unshift(e.nodes.find((e=>e.index===2*o+1)));return{values:n,nodes:i}}))}imprint(e){return n(this,void 0,void 0,(function*(){const t=[...yield Promise.all(e.values.map(((e,t)=>n(this,void 0,void 0,(function*(){const n=yield this._options.hasher(e.value,[t],r.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],r.LEAF),value:e.value}}))))),...e.nodes];for(let e=Math.max(...t.map((e=>e.index+1)),0)-1;e>=0;e-=2){const n=t.find((t=>t.index===e)),i=t.find((t=>t.index===e-1));n&&i&&t.unshift({index:e-2,hash:yield this._options.hasher(`${i.hash}${n.hash}`,[e],r.NODE)})}const i=t.find((e=>0===e.index));return i?i.hash:null}))}}},2461:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5836),t)},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9230),r(5291),r(8344),r(5508))})(); \ No newline at end of file +(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],g=8191&y,A=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,w=0|s[5],b=8191&w,R=w>>>13,N=0|s[6],M=8191&N,P=N>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,G=0|s[9],j=8191&G,U=G>>>13,F=0|a[0],B=8191&F,K=F>>>13,V=0|a[1],Y=8191&V,z=V>>>13,X=0|a[2],H=8191&X,W=X>>>13,$=0|a[3],Z=8191&$,q=$>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,B))|0)+((8191&(i=(i=Math.imul(h,K))+Math.imul(l,B)|0))<<13)|0;d=((o=Math.imul(l,K))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,K))+Math.imul(v,B)|0,o=Math.imul(v,K);var me=(d+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,B),i=(i=Math.imul(m,K))+Math.imul(E,B)|0,o=Math.imul(E,K),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,z)|0;var Ee=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(g,B),i=(i=Math.imul(g,K))+Math.imul(A,B)|0,o=Math.imul(A,K),n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,Z)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,B),i=(i=Math.imul(I,K))+Math.imul(T,B)|0,o=Math.imul(T,K),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,q)|0;var ge=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(b,B),i=(i=Math.imul(b,K))+Math.imul(R,B)|0,o=Math.imul(R,K),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var Ae=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,K))+Math.imul(P,B)|0,o=Math.imul(P,K),n=n+Math.imul(b,Y)|0,i=(i=i+Math.imul(b,z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,B),i=(i=Math.imul(D,K))+Math.imul(x,B)|0,o=Math.imul(x,K),n=n+Math.imul(M,Y)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(P,Y)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(b,H)|0,i=(i=i+Math.imul(b,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,K))+Math.imul(k,B)|0,o=Math.imul(k,K),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,q)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,K))+Math.imul(U,B)|0,o=Math.imul(U,K),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(P,Z)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(b,Q)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var we=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(j,Y),i=(i=Math.imul(j,z))+Math.imul(U,Y)|0,o=Math.imul(U,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,de)|0,n=n+Math.imul(m,he)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,le)|0;var be=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,W))+Math.imul(U,H)|0,o=Math.imul(U,W),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(b,oe)|0,i=(i=i+Math.imul(b,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Re=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ve)|0)+Math.imul(E,pe)|0))<<13)|0;d=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,q))+Math.imul(U,Z)|0,o=Math.imul(U,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var Ne=(d+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(A,pe)|0))<<13)|0;d=((o=o+Math.imul(A,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(j,Q),i=(i=Math.imul(j,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,de)|0,n=n+Math.imul(b,he)|0,i=(i=i+Math.imul(b,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Me=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(j,re),i=(i=Math.imul(j,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(d+(n=n+Math.imul(b,pe)|0)|0)+((8191&(i=(i=i+Math.imul(b,ve)|0)+Math.imul(R,pe)|0))<<13)|0;d=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(j,oe),i=(i=Math.imul(j,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;d=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(j,ue),i=(i=Math.imul(j,de))+Math.imul(U,ue)|0,o=Math.imul(U,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(j,he),i=(i=Math.imul(j,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(j,pe))|0)+((8191&(i=(i=Math.imul(j,ve))+Math.imul(U,pe)|0))<<13)|0;return d=((o=Math.imul(U,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=me,u[2]=Ee,u[3]=ye,u[4]=ge,u[5]=Ae,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=we,u[10]=be,u[11]=Re,u[12]=Ne,u[13]=Me,u[14]=Pe,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(y,E),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return m[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,w,b,R,N,M,P,S,D,x,L,C,k,G,j,U,F,B,K,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,w=e[6]<<28|e[7]>>>4,b=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=w^~R&M,e[11]=b^~N&P,e[20]=C^~G&U,e[21]=k^~j&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~M&S,e[13]=N^~P&D,e[22]=G^~U&B,e[23]=j^~F&K,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=U^~B&V,e[25]=F^~K&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&w,e[17]=D^~L&b,e[26]=B^~V&C,e[27]=K^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~w&R,e[19]=L^~b&N,e[28]=V^~C&G,e[29]=Y^~k&j,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];m%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new g(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new g(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new g(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}g.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(A(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&A(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,w,b,R,N,M,P,S,D,x,L,C,k,G,j,U,F,B,K,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,w=e[6]<<28|e[7]>>>4,b=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,B=e[38]<<8|e[39]>>>24,K=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=w^~R&M,e[11]=b^~N&P,e[20]=C^~G&U,e[21]=k^~j&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~M&S,e[13]=N^~P&D,e[22]=G^~U&B,e[23]=j^~F&K,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=U^~B&V,e[25]=F^~K&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&w,e[17]=D^~L&b,e[26]=B^~V&C,e[27]=K^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~w&R,e[19]=L^~b&N,e[28]=V^~C&G,e[29]=Y^~k&j,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(m))throw new Error('invalid identifier: "'+n[1]+'"');if(j(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");j(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var A=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(A),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(A),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=w.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new R(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new G(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var B=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new G(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new G(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=B,t.defaultAbiCoder=new B},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},5736:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Cert=void 0;const i=r(2461),o=r(5353),s=r(7077);class a{constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>n(this,void 0,void 0,(function*(){return o.sha(256,s.toString(e))})),noncer:e=>n(this,void 0,void 0,(function*(){return o.sha(256,e.join("."))}))},e))}static getInstance(e){return new a(e)}identify(e){return n(this,void 0,void 0,(function*(){return o.sha(256,JSON.stringify(!1!==e?this.sortSchema(this.schema):this.schema))}))}notarize(e){return n(this,void 0,void 0,(function*(){const t=this.buildSchemaProps(e),r=yield this.buildCompoundProps(t);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(r)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}expose(e,t){const r={};return t.forEach((t=>{const n=s.readPath(t,e);s.writePath(t,n,r)})),JSON.parse(JSON.stringify(r))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=this.buildSchemaProps(e),n=yield this.buildCompoundProps(r);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(n,t)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}calculate(e,t){return n(this,void 0,void 0,(function*(){try{return this.checkDataInclusion(e,t.data)?this.imprintRecipes(t.data):null}catch(e){return null}}))}imprint(e){return n(this,void 0,void 0,(function*(){return this.notarize(e).then((e=>e.data[0].nodes[0].hash)).catch((()=>null))}))}buildSchemaProps(e,t=this.schema,r=[]){if("array"===t.type){const n=(e||[]).map(((e,n)=>this.buildSchemaProps(e,t.items,[...r,n]))).reduce(((e,t)=>e.concat(t)),[]);return n.length>0?n:[this.buildSchemaProps(void 0,{},[...r])]}return"object"===t.type?Object.keys(t.properties).sort().map((n=>{const i=this.buildSchemaProps((e||{})[n],t.properties[n],[...r,n]);return-1===["object","array"].indexOf(t.properties[n].type)?[i]:i})).reduce(((e,t)=>e.concat(t)),[]):{path:r,value:e,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(e){return n(this,void 0,void 0,(function*(){e=[...e];const t=this.buildPropGroups(e),r=Object.keys(t).sort(((e,t)=>e>t?-1:1)).filter((e=>""!==e));for(const n of r){const r=t[n],i=[...e.filter((e=>e.group===n))].sort(((e,t)=>e.key>t.key?1:-1)).map((e=>e.value)),o=yield this.merkle.notarize(i,r);e.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return e.sort(((e,t)=>e.key>t.key?1:-1))}))}buildRecipes(e,t=null){return n(this,void 0,void 0,(function*(){const r=t?s.stepPaths(t).map((e=>e.join("."))):null,i={};return e.forEach((e=>i[e.group]=e.path.slice(0,-1))),Promise.all(Object.keys(i).map((t=>n(this,void 0,void 0,(function*(){const n=e.filter((e=>e.group===t)).map((e=>e.value));let o=yield this.merkle.notarize(n,i[t]);if(r){const n=e.filter((e=>e.group===t)).map(((e,t)=>-1===r.indexOf(e.key)?-1:t)).filter((e=>-1!==e));o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[t].join(".")))return{path:i[t],values:o.values,nodes:o.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))))).then((e=>e.filter((e=>!!e))))}))}checkDataInclusion(e,t){const r=this.buildSchemaProps(e);t=s.cloneObject(t).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e)));for(const n of r){const r=s.readPath(n.path,e);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=t.find((e=>e.key===i));if(!o)return!1;const a=this.getPathIndexes(n.path).pop(),u=o.values.find((e=>e.index===a));if(void 0!==u&&u.value!==r)return!1}return!0}imprintRecipes(e){return n(this,void 0,void 0,(function*(){if(0===e.length)return this.getEmptyImprint();e=s.cloneObject(e).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e))).sort(((e,t)=>e.path.length>t.path.length?-1:1));for(const t of e){const r=yield this.merkle.imprint(t).catch((()=>""));t.nodes.unshift({index:0,hash:r});const n=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),o=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find((e=>e.key===n));s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const t=e.find((e=>""===e.key));return t?t.nodes.find((e=>0===e.index)).hash:this.getEmptyImprint()}))}getPathIndexes(e){const t=[];let r=this.schema;for(const n of e)"array"===r.type?(t.push(n),r=r.items):"object"===r.type?(t.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):t.push(void 0);return t}getEmptyImprint(){return n(this,void 0,void 0,(function*(){return this.merkle.notarize([]).then((e=>e.nodes[0].hash))}))}buildPropGroups(e){const t={};return e.map((e=>{const t=[];return e.path.map((e=>(t.push(e),[...t])))})).reduce(((e,t)=>e.concat(t)),[]).forEach((e=>t[e.slice(0,-1).join(".")]=e.slice(0,-1))),t}sortSchema(e){return Object.keys(e).sort().reduce(((t,r)=>(Array.isArray(e[r])?t[r]=e[r].sort():"object"==typeof e[r]?t[r]=this.sortSchema(e[r]):t[r]=e[r],t)),{})}}t.Cert=a},3377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9230:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5736),t),i(r(3377),t)},7077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writePath=t.readPath=t.stepPaths=t.cloneObject=t.toString=void 0,t.toString=function(e){try{return null==e?"":`${e}`}catch(e){return""}},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.stepPaths=function(e){const t={"":[]};return e.forEach((e=>{const r=[];e.forEach((e=>{r.push(e),t[r.join(".")]=[...r]}))})),Object.keys(t).sort().map((e=>t[e]))},t.readPath=function e(t,r){try{return Array.isArray(t)?0===t.length?r:e(t.slice(1),r[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,r={}){let n=r=r||{};for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),m=r(8634),E=r(7045),y=r(5636),g=r(6075),A=r(8608),O=r(1785),I=r(7461),T=r(2746),w=r(3924),b=r(5434),R=r(6651),N=r(8453),M=r(9085),P=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),G=r(1399),j=r(9156),U=r(3022),F=r(9669),B=r(7734),K=r(4909),V=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?N.default(this,e):R.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):U.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),m.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),E.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=V.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case V.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=V.ProxyId.NFTOKEN_TRANSFER);break;case V.ProxyKind.CREATE_ASSET:t=V.ProxyId.XCERT_CREATE;break;case V.ProxyKind.DESTROY_ASSET:t=V.ProxyId.XCERT_BURN;break;case V.ProxyKind.MANAGE_ABILITIES:t=V.ProxyId.MANAGE_ABILITIES;break;case V.ProxyKind.TRANSFER_TOKEN:t=V.ProxyId.TOKEN_TRANSFER;break;case V.ProxyKind.UPDATE_ASSET:t=V.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return w.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),b.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),b.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),j.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8218:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),d=r(6512),c=r(7061),h=r(3919),l=r(8926),f=r(2328);t.ValueLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),h.default(this,e,t)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),l.default(this,e)}))}getInfo(){return n(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(e,t,r){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,t,r);return o.bigNumberify(n).gte(o.bigNumberify(e))}))}approveValue(e,t){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t);const r=yield this.getApprovedValue(this.provider.accountId,t);if(!o.bigNumberify(e).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,t,e)}))}disapproveValue(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),a.default(this,e,"0")}))}transferValue(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return e.senderId?c.default(this,t,r,e.value):d.default(this,r,e.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8218),t)},646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=["string","string","uint8","uint256"];t.default=function(e,{name:t,symbol:r,decimals:a,supply:u}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.valueLedgerSource)).TokenMock.evm.bytecode.object,d={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(s,[t,r,a,u]).substr(2)}`},c=yield e.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e,c.result)}))}},7061:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},6512:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa9059cbb"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3919:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xdd62ed3e"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},8926:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},2328:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],decimals:t[2],supply:t[3]}}))}},5836:function(e,t){"use strict";var r,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Merkle=t.MerkleHasherPosition=void 0,function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(r=t.MerkleHasherPosition||(t.MerkleHasherPosition={})),t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,r){return this._options.hasher(e,t,r)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return n(this,void 0,void 0,(function*(){const n=[...e],i=[],o=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(o,[...t,n.length],r.NODE)];for(let e=n.length-1;e>=0;e--){const o=s[0];i.unshift(yield this._options.noncer([...t,e]));const a=yield this._options.hasher(n[e],[...t,e],r.VALUE);s.unshift(yield this._options.hasher(`${a}${i[0]}`,[...t,e],r.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${o}`,[...t,e],r.NODE))}return{values:n.map(((e,t)=>({index:t,value:e,nonce:i[t]}))),nodes:s.map(((e,t)=>({index:t,hash:e})))}}))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=Math.max(...t.map((e=>e+1)),0),n=[],i=[e.nodes.find((e=>e.index===2*r))];for(let o=r-1;o>=0;o--)-1!==t.indexOf(o)?n.unshift(e.values.find((e=>e.index===o))):i.unshift(e.nodes.find((e=>e.index===2*o+1)));return{values:n,nodes:i}}))}imprint(e){return n(this,void 0,void 0,(function*(){const t=[...yield Promise.all(e.values.map(((e,t)=>n(this,void 0,void 0,(function*(){const n=yield this._options.hasher(e.value,[t],r.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],r.LEAF),value:e.value}}))))),...e.nodes];for(let e=Math.max(...t.map((e=>e.index+1)),0)-1;e>=0;e-=2){const n=t.find((t=>t.index===e)),i=t.find((t=>t.index===e-1));n&&i&&t.unshift({index:e-2,hash:yield this._options.hasher(`${i.hash}${n.hash}`,[e],r.NODE)})}const i=t.find((e=>0===e.index));return i?i.hash:null}))}}},2461:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5836),t)},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9230),r(5291),r(8344),r(5508))})(); \ No newline at end of file diff --git a/dist/0xcert-wanchain-asset-ledger.min.js b/dist/0xcert-wanchain-asset-ledger.min.js index 36aef7d11..3e0d00172 100644 --- a/dist/0xcert-wanchain-asset-ledger.min.js +++ b/dist/0xcert-wanchain-asset-ledger.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-wanchain-asset-ledger.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function d(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,c=67108863&u,l=Math.min(d,e.length-1),f=Math.max(0,d-t.length+1);f<=l;f++){var p=d-f|0;h+=(s=(n=0|t.words[p])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[d]=0|c,u=0|h}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],f=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:h[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,d=new t(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,w=0|s[4],T=8191&w,M=w>>>13,N=0|s[5],I=8191&N,R=N>>>13,O=0|s[6],b=8191&O,P=O>>>13,S=0|s[7],D=8191&S,L=S>>>13,C=0|s[8],x=8191&C,G=C>>>13,U=0|s[9],k=8191&U,B=U>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],z=8191&X,Z=X>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,dt=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(d+(i=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,Y))+Math.imul(l,F)|0))<<13)|0;d=((o=Math.imul(l,Y))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(v,F)|0,o=Math.imul(v,Y);var mt=(d+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(l,W)|0))<<13)|0;d=((o=o+Math.imul(l,K)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,F),n=(n=Math.imul(m,Y))+Math.imul(E,F)|0,o=Math.imul(E,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,K)|0;var Et=(d+(i=i+Math.imul(c,z)|0)|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(l,z)|0))<<13)|0;d=((o=o+Math.imul(l,Z)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(g,F)|0,o=Math.imul(g,Y),i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,K)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var yt=(d+(i=i+Math.imul(c,q)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(l,q)|0))<<13)|0;d=((o=o+Math.imul(l,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,Y))+Math.imul(M,F)|0,o=Math.imul(M,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,K)|0,i=i+Math.imul(m,z)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var At=(d+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,Y))+Math.imul(R,F)|0,o=Math.imul(R,Y),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,K)|0,i=i+Math.imul(A,z)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(d+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(l,rt)|0))<<13)|0;d=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(P,F)|0,o=Math.imul(P,Y),i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,K)|0,i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,Z)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var wt=(d+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;d=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,K)|0,i=i+Math.imul(I,z)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(d+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(l,ut)|0))<<13)|0;d=((o=o+Math.imul(l,dt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(G,F)|0,o=Math.imul(G,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,dt)|0;var Mt=(d+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;d=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(G,W)|0,o=o+Math.imul(G,K)|0,i=i+Math.imul(D,z)|0,n=(n=n+Math.imul(D,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,dt)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Nt=(d+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,vt)|0)+Math.imul(l,pt)|0))<<13)|0;d=((o=o+Math.imul(l,vt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(G,z)|0,o=o+Math.imul(G,Z)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,dt)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var It=(d+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;d=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(G,q)|0,o=o+Math.imul(G,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,dt)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var Rt=(d+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,vt)|0)+Math.imul(E,pt)|0))<<13)|0;d=((o=o+Math.imul(E,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(G,Q)|0,o=o+Math.imul(G,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(I,ut)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,dt)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var Ot=(d+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,vt)|0)+Math.imul(g,pt)|0))<<13)|0;d=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(G,rt)|0,o=o+Math.imul(G,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,dt)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var bt=(d+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,vt)|0)+Math.imul(M,pt)|0))<<13)|0;d=((o=o+Math.imul(M,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(G,ot)|0,o=o+Math.imul(G,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,dt)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,dt)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,lt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,lt)|0;var Pt=(d+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,vt)|0)+Math.imul(R,pt)|0))<<13)|0;d=((o=o+Math.imul(R,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,dt)|0)+Math.imul(G,ut)|0,o=o+Math.imul(G,dt)|0,i=i+Math.imul(D,ct)|0,n=(n=n+Math.imul(D,lt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,lt)|0;var St=(d+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;d=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,dt))+Math.imul(B,ut)|0,o=Math.imul(B,dt),i=i+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(G,ct)|0,o=o+Math.imul(G,lt)|0;var Dt=(d+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,vt)|0)+Math.imul(L,pt)|0))<<13)|0;d=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ct),n=(n=Math.imul(k,lt))+Math.imul(B,ct)|0,o=Math.imul(B,lt);var Lt=(d+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(G,pt)|0))<<13)|0;d=((o=o+Math.imul(G,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(d+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return d=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=mt,u[2]=Et,u[3]=yt,u[4]=At,u[5]=gt,u[6]=wt,u[7]=Tt,u[8]=Mt,u[9]=Nt,u[10]=It,u[11]=Rt,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=St,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==d&&(u[19]=d,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==h||d>=n);d--){var c=0|this.words[d];this.words[d]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;c--){var l=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,c);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++d;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,f=1;0==(e.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(h),s.isub(c)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,h=1;0==(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},n(y,E),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new A;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},T.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,d).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,n),l=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var d=e.words[i],h=u-1;h>=0;h--){var c=d>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===i&&0===h)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,T),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,d,h,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,G,U,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,dt,ht;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],d=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(d<<1|h>>>31),r=s^(h<<1|d>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=d^(f<<1|p>>>31),r=h^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(o<<1|s>>>31),r=l^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,G=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,dt=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~U&B,t[21]=G^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=U^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&dt,t[45]=st^~ut&ht,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&G,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~dt&et,t[47]=ut^~ht&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&U,t[29]=W^~G&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=dt^~et&it,t[49]=ht^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,d=t.blockCount<<2,h=t.blockCount,c=t.outputBlocks,l=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(t.start=_-d,t.block=u[h],_=0;_>2]|=r[3&_],t.lastByteIndex===d)for(u[0]=u[h],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];m%h==0&&(o(l),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var d=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=d},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(t,e){u>a[t]||console.log.apply(console,e)}function h(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},h=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},c=function(t,e){var r=d(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,h=this.s;d>2]|=t[d]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,d,h,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,G,U,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,dt,ht;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],d=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(d<<1|h>>>31),r=o^(h<<1|d>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=d^(f<<1|p>>>31),r=h^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,G=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,dt=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~U&B,t[21]=G^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=U^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&dt,t[45]=st^~ut&ht,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&G,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~dt&et,t[47]=ut^~ht&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&U,t[29]=W^~G&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=dt^~et&it,t[49]=ht^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=d.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(m))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(y(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(y(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},w=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return l.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return h.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),M=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=d.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),h.padZeros(h.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=N.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new M(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new R(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=l.shallowCopy(e)).type=r[1],e=l.deepCopy(e),new G(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new U(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):t,r.push(j(this.coerceFunc,e))}),this),h.hexlify(new U(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):l.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new U(this.coerceFunc,r,"_").decode(h.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var h={},c=0;c<10;c++)h[String(c)]=String(c);for(c=0;c<26;c++)h[String.fromCharCode(65+c)]=String(10+c);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=h[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=d(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=d("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),d=new o.default.BN(-1);function h(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function c(t){return f(v(t))}function l(t){return new p(h(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(d):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",h(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",h(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",h(c(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",h(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return l(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return l(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},t.prototype.add=function(t){return l(f(this).add(c(t)))},t.prototype.sub=function(t){return l(f(this).sub(c(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(c(t)))},t.prototype.mul=function(t){return l(f(this).mul(c(t)))},t.prototype.mod=function(t){return l(f(this).mod(c(t)))},t.prototype.pow=function(t){return l(f(this).pow(c(t)))},t.prototype.maskn=function(t){return l(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(c(t))},t.prototype.lt=function(t){return f(this).lt(c(t))},t.prototype.lte=function(t){return f(this).lte(c(t))},t.prototype.gt=function(t){return f(this).gt(c(t))},t.prototype.gte=function(t){return f(this).gte(c(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=c[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+c[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(h(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=l,e.hexDataLength=function(t){return h(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return h(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(h(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return l(d([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,d=0;d1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function d(t,e,r,i){var n,o,s,d;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,d=h,console&&console.warn&&console.warn(d)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var d=u.length,h=p(u,d);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},6428:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedger=void 0;const n=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),h=r(8943),c=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),m=r(4583),E=r(5421),y=r(2513),A=r(1999),g=r(1741),w=r(3206),T=r(8661),M=r(195),N=r(8548),I=r(4977),R=r(5289),O=r(1066),b=r(4373),P=r(7877);e.AssetLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),A.default(this,t)}))}getApprovedAccount(t){return i(this,void 0,void 0,(function*(){return w.default(this,t)}))}getAssetAccount(t){return i(this,void 0,void 0,(function*(){return M.default(this,t)}))}getAsset(t){return i(this,void 0,void 0,(function*(){return T.default(this,t)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),I.default(this,t)}))}getCapabilities(){return i(this,void 0,void 0,(function*(){return R.default(this)}))}getInfo(){return i(this,void 0,void 0,(function*(){return O.default(this)}))}getAssetIdAt(t){return i(this,void 0,void 0,(function*(){return N.default(this,t)}))}getAccountAssetIdAt(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),g.default(this,t,e)}))}isApprovedAccount(t,e){return i(this,void 0,void 0,(function*(){return(e=this._provider.encoder.normalizeAddress(e))===(yield w.default(this,t))}))}isTransferable(){return i(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(t,e){return i(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)}))}disapproveAccount(t){return i(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)}))}grantAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),h.default(this,t,o.getBitfieldFromAbilities(e))}))}setAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),p.default(this,t,o.getBitfieldFromAbilities(e))}))}createAsset(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.receiverId);return a.default(this,e,t.id,`0x${t.imprint}`)}))}destroyAsset(t){return i(this,void 0,void 0,(function*(){return d.default(this,t)}))}revokeAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t,o.getBitfieldFromAbilities(e))}))}revokeAsset(t){return i(this,void 0,void 0,(function*(){return l.default(this,t)}))}transferAsset(t){return i(this,void 0,void 0,(function*(){t.senderId||(t.senderId=this.provider.accountId);const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(t.receiverId)?m.default(this,e,r,t.id):f.default(this,e,r,t.id,t.data)}))}enableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(t,e){return i(this,void 0,void 0,(function*(){return y.default(this,t,`0x${e.imprint}`)}))}update(t){return i(this,void 0,void 0,(function*(){return E.default(this,t.uriPrefix,t.uriPostfix)}))}approveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!0)}))}disapproveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!1)}))}isApprovedOperator(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),b.default(this,t,e)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:n.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:n.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(e,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(e,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(e,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),n(r(6428),e),n(r(365),e),n(r(5378),e)},5378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBitfieldFromAbilities=void 0;const i=r(2624);e.getBitfieldFromAbilities=function(t){let e=i.bigNumberify(0);return t.forEach((t=>{e=e.add(t)})),e.toHexString()}},365:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInterfaceCode=void 0;const i=r(6112);e.getInterfaceCode=function(t){return t==i.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==i.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==i.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":t==i.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},212:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256","bytes32"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xb0e329e4"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},3967:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:h,capabilities:c}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(c||[]).map((t=>s.getInterfaceCode(t))),f={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(a,[e,r,u,d,`0x${h}`,l]).substr(2)}`},p=yield t.post({method:"eth_sendTransaction",params:[f]});return new n.Mutation(t,p.result)}))}},8260:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x9d118770"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},8943:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0ab319e8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},4494:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xf394b6df"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x20c5429b"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},1463:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279);e.default=function(t,e,r,o,s){return i(this,void 0,void 0,(function*(){const i=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[e,r,o,s].filter((t=>void 0!==t)),d={from:t.provider.accountId,to:t.id,data:i+t.provider.encoder.encodeParameters(a,u).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[d]});return new n.Mutation(t.provider,h.result,t)}))}},7234:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x15ec3b8b"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3016:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","bool"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa22cb465"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5641:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0xbedb86fb"+t.provider.encoder.encodeParameters(o,[!e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},4583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},2513:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256","bytes32"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0d04c3b8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5421:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["string","string"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x89b73ec0"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1999:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=["address","uint256"],s=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){return Promise.all([n.SuperAssetLedgerAbility.MANAGE_ABILITIES,n.GeneralAssetLedgerAbility.CREATE_ASSET,n.GeneralAssetLedgerAbility.REVOKE_ASSET,n.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,n.GeneralAssetLedgerAbility.UPDATE_ASSET,n.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,n.GeneralAssetLedgerAbility.UPDATE_URI_BASE,n.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>i(this,void 0,void 0,(function*(){const i={to:t.id,data:"0xba00a330"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]?r:-1}))))).then((t=>t.filter((t=>-1!==t)).sort(((t,e)=>t-e)))).catch((e=>(t.provider.log(e),[])))}))}},1741:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","uint256"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x2f745c59"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},3206:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(9512),o=["uint256"],s=["address"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x081812fc"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,i.result)[0]}catch(r){return t.provider.log(r),n.default(t,e)}}))}},195:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x6352211e"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8548:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x4f6ccce7"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8661:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];e.default=function(t,e){return r(this,void 0,void 0,(function*(){const n=yield Promise.all(i.map((i=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:i.signature+t.provider.encoder.encodeParameters(i.inputTypes,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(i.outputTypes,n.result)[0]}catch(e){return t.provider.log(e),null}})))));return{id:e,uri:n[0],imprint:n[1]?n[1].substr(2):null,schemaId:n[2]?n[2].substr(2):null}}))}},4977:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},5289:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=r(365),s=["bytes4"],a=["bool"];e.default=function(t){return i(this,void 0,void 0,(function*(){return Promise.all([n.AssetLedgerCapability.DESTROY_ASSET,n.AssetLedgerCapability.REVOKE_ASSET,n.AssetLedgerCapability.TOGGLE_TRANSFERS,n.AssetLedgerCapability.UPDATE_ASSET].map((e=>i(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(e),i={to:t.id,data:"0x01ffc9a7"+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(a,n.result)[0]?e:-1}))))).then((t=>t.filter((t=>-1!==t)).sort())).catch((e=>(t.provider.log(e),[])))}))}},1066:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],uriPrefix:e[2],uriPostfix:e[3],supply:e[4]}}))}},4373:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["bool"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xe985e9c5"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},7877:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[],n=["bool"];e.default=function(t){return r(this,void 0,void 0,(function*(){try{const e={to:t.id,data:"0xb187bd26"+t.provider.encoder.encodeParameters(i,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(n,r.result)[0]}catch(e){return t.provider.log(e),null}}))}},9512:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x481af3d3"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class d extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=d},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=d},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},2895:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedger=void 0;const i=r(5291);class n extends i.AssetLedger{}e.AssetLedger=n},7745:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0;var o=r(5291);Object.defineProperty(e,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(e,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(e,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),n(r(2895),e)},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(7745))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function d(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,h=r;h1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,c=67108863&u,l=Math.min(d,e.length-1),f=Math.max(0,d-t.length+1);f<=l;f++){var p=d-f|0;h+=(s=(n=0|t.words[p])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[d]=0|c,u=0|h}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?h[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var d=c[t],f=l[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:h[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,d=new t(o),h=this.clone();if(u){for(a=0;!h.isZero();a++)s=h.andln(255),h.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,w=0|s[4],T=8191&w,M=w>>>13,N=0|s[5],I=8191&N,R=N>>>13,O=0|s[6],b=8191&O,P=O>>>13,S=0|s[7],D=8191&S,L=S>>>13,C=0|s[8],x=8191&C,G=C>>>13,U=0|s[9],k=8191&U,B=U>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],z=8191&X,Z=X>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,dt=at>>>13,ht=0|a[8],ct=8191&ht,lt=ht>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(d+(i=Math.imul(c,F))|0)+((8191&(n=(n=Math.imul(c,Y))+Math.imul(l,F)|0))<<13)|0;d=((o=Math.imul(l,Y))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(v,F)|0,o=Math.imul(v,Y);var mt=(d+(i=i+Math.imul(c,W)|0)|0)+((8191&(n=(n=n+Math.imul(c,K)|0)+Math.imul(l,W)|0))<<13)|0;d=((o=o+Math.imul(l,K)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(m,F),n=(n=Math.imul(m,Y))+Math.imul(E,F)|0,o=Math.imul(E,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,K)|0;var Et=(d+(i=i+Math.imul(c,z)|0)|0)+((8191&(n=(n=n+Math.imul(c,Z)|0)+Math.imul(l,z)|0))<<13)|0;d=((o=o+Math.imul(l,Z)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(g,F)|0,o=Math.imul(g,Y),i=i+Math.imul(m,W)|0,n=(n=n+Math.imul(m,K)|0)+Math.imul(E,W)|0,o=o+Math.imul(E,K)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var yt=(d+(i=i+Math.imul(c,q)|0)|0)+((8191&(n=(n=n+Math.imul(c,$)|0)+Math.imul(l,q)|0))<<13)|0;d=((o=o+Math.imul(l,$)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(T,F),n=(n=Math.imul(T,Y))+Math.imul(M,F)|0,o=Math.imul(M,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,K)|0,i=i+Math.imul(m,z)|0,n=(n=n+Math.imul(m,Z)|0)+Math.imul(E,z)|0,o=o+Math.imul(E,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var At=(d+(i=i+Math.imul(c,Q)|0)|0)+((8191&(n=(n=n+Math.imul(c,tt)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(I,F),n=(n=Math.imul(I,Y))+Math.imul(R,F)|0,o=Math.imul(R,Y),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,K)|0)+Math.imul(M,W)|0,o=o+Math.imul(M,K)|0,i=i+Math.imul(A,z)|0,n=(n=n+Math.imul(A,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(m,q)|0,n=(n=n+Math.imul(m,$)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(d+(i=i+Math.imul(c,rt)|0)|0)+((8191&(n=(n=n+Math.imul(c,it)|0)+Math.imul(l,rt)|0))<<13)|0;d=((o=o+Math.imul(l,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(P,F)|0,o=Math.imul(P,Y),i=i+Math.imul(I,W)|0,n=(n=n+Math.imul(I,K)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,K)|0,i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(M,z)|0,o=o+Math.imul(M,Z)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(m,Q)|0,n=(n=n+Math.imul(m,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var wt=(d+(i=i+Math.imul(c,ot)|0)|0)+((8191&(n=(n=n+Math.imul(c,st)|0)+Math.imul(l,ot)|0))<<13)|0;d=((o=o+Math.imul(l,st)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,K)|0,i=i+Math.imul(I,z)|0,n=(n=n+Math.imul(I,Z)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,Z)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(m,rt)|0,n=(n=n+Math.imul(m,it)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(d+(i=i+Math.imul(c,ut)|0)|0)+((8191&(n=(n=n+Math.imul(c,dt)|0)+Math.imul(l,ut)|0))<<13)|0;d=((o=o+Math.imul(l,dt)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(G,F)|0,o=Math.imul(G,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(I,q)|0,n=(n=n+Math.imul(I,$)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(m,ot)|0,n=(n=n+Math.imul(m,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,dt)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,dt)|0;var Mt=(d+(i=i+Math.imul(c,ct)|0)|0)+((8191&(n=(n=n+Math.imul(c,lt)|0)+Math.imul(l,ct)|0))<<13)|0;d=((o=o+Math.imul(l,lt)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(G,W)|0,o=o+Math.imul(G,K)|0,i=i+Math.imul(D,z)|0,n=(n=n+Math.imul(D,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(I,Q)|0,n=(n=n+Math.imul(I,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(m,ut)|0,n=(n=n+Math.imul(m,dt)|0)+Math.imul(E,ut)|0,o=o+Math.imul(E,dt)|0,i=i+Math.imul(p,ct)|0,n=(n=n+Math.imul(p,lt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,lt)|0;var Nt=(d+(i=i+Math.imul(c,pt)|0)|0)+((8191&(n=(n=n+Math.imul(c,vt)|0)+Math.imul(l,pt)|0))<<13)|0;d=((o=o+Math.imul(l,vt)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(G,z)|0,o=o+Math.imul(G,Z)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(I,rt)|0,n=(n=n+Math.imul(I,it)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,dt)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,dt)|0,i=i+Math.imul(m,ct)|0,n=(n=n+Math.imul(m,lt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,lt)|0;var It=(d+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;d=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(G,q)|0,o=o+Math.imul(G,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(I,ot)|0,n=(n=n+Math.imul(I,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,dt)|0)+Math.imul(M,ut)|0,o=o+Math.imul(M,dt)|0,i=i+Math.imul(A,ct)|0,n=(n=n+Math.imul(A,lt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,lt)|0;var Rt=(d+(i=i+Math.imul(m,pt)|0)|0)+((8191&(n=(n=n+Math.imul(m,vt)|0)+Math.imul(E,pt)|0))<<13)|0;d=((o=o+Math.imul(E,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(G,Q)|0,o=o+Math.imul(G,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(I,ut)|0,n=(n=n+Math.imul(I,dt)|0)+Math.imul(R,ut)|0,o=o+Math.imul(R,dt)|0,i=i+Math.imul(T,ct)|0,n=(n=n+Math.imul(T,lt)|0)+Math.imul(M,ct)|0,o=o+Math.imul(M,lt)|0;var Ot=(d+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,vt)|0)+Math.imul(g,pt)|0))<<13)|0;d=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(G,rt)|0,o=o+Math.imul(G,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,dt)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,dt)|0,i=i+Math.imul(I,ct)|0,n=(n=n+Math.imul(I,lt)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,lt)|0;var bt=(d+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,vt)|0)+Math.imul(M,pt)|0))<<13)|0;d=((o=o+Math.imul(M,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(G,ot)|0,o=o+Math.imul(G,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,dt)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,dt)|0,i=i+Math.imul(b,ct)|0,n=(n=n+Math.imul(b,lt)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,lt)|0;var Pt=(d+(i=i+Math.imul(I,pt)|0)|0)+((8191&(n=(n=n+Math.imul(I,vt)|0)+Math.imul(R,pt)|0))<<13)|0;d=((o=o+Math.imul(R,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,dt)|0)+Math.imul(G,ut)|0,o=o+Math.imul(G,dt)|0,i=i+Math.imul(D,ct)|0,n=(n=n+Math.imul(D,lt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,lt)|0;var St=(d+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;d=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,dt))+Math.imul(B,ut)|0,o=Math.imul(B,dt),i=i+Math.imul(x,ct)|0,n=(n=n+Math.imul(x,lt)|0)+Math.imul(G,ct)|0,o=o+Math.imul(G,lt)|0;var Dt=(d+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,vt)|0)+Math.imul(L,pt)|0))<<13)|0;d=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ct),n=(n=Math.imul(k,lt))+Math.imul(B,ct)|0,o=Math.imul(B,lt);var Lt=(d+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(G,pt)|0))<<13)|0;d=((o=o+Math.imul(G,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(d+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return d=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=mt,u[2]=Et,u[3]=yt,u[4]=At,u[5]=gt,u[6]=wt,u[7]=Tt,u[8]=Mt,u[9]=Nt,u[10]=It,u[11]=Rt,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=St,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==d&&(u[19]=d,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e),r},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==h||d>=n);d--){var c=0|this.words[d];this.words[d]=h<<26-o|c>>>o,h=c&a}return u&&0!==h&&(u.words[u.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;c--){var l=67108864*(0|i.words[n.length+c])+(0|i.words[n.length+c-1]);for(l=Math.min(l/s|0,67108863),i._ishlnsubmul(n,l,c);0!==i.negative;)l--,i.negative=0,i._ishlnsubmul(n,1,c),i.isZero()||(i.negative^=1);a&&(a.words[c]=l)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++d;for(var h=r.clone(),c=e.clone();!e.isZero();){for(var l=0,f=1;0==(e.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(e.iushrn(l);l-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(h),s.isub(c)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(h),u.isub(c)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,h=1;0==(e.words[0]&h)&&d<26;++d,h<<=1);if(d>0)for(e.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var c=0,l=1;0==(r.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(r.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var m={k256:null,p224:null,p192:null,p25519:null};function E(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function w(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function M(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},E.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(t,e){t.iushrn(this.n,0,e)},E.prototype.imulK=function(t){return t.imul(this.k)},n(y,E),y.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(m[t])return m[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new A;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new w}return m[t]=e,e},T.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,d).cmp(u);)h.redIAdd(u);for(var c=this.pow(h,n),l=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var d=e.words[i],h=u-1;h>=0;h--){var c=d>>h&1;n!==r[0]&&(n=this.sqr(n)),0!==c||0!==s?(s<<=1,s|=c,(4==++a||0===i&&0===h)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new M(t)},n(M,T),M.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},M.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},M.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},M.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},M.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,d,h,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,G,U,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,dt,ht;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],d=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(d<<1|h>>>31),r=s^(h<<1|d>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=d^(f<<1|p>>>31),r=h^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(o<<1|s>>>31),r=l^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,G=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,dt=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~U&B,t[21]=G^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=U^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&dt,t[45]=st^~ut&ht,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&G,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~dt&et,t[47]=ut^~ht&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&U,t[29]=W^~G&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=dt^~et&it,t[49]=ht^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,d=t.blockCount<<2,h=t.blockCount,c=t.outputBlocks,l=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(t.start=_-d,t.block=u[h],_=0;_>2]|=r[3&_],t.lastByteIndex===d)for(u[0]=u[h],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];m%h==0&&(o(l),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var d=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=d},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(t,e){u>a[t]||console.log.apply(console,e)}function h(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},h=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},c=function(t,e){var r=d(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,h=this.s;d>2]|=t[d]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,d,h,c,l,f,p,v,_,m,E,y,A,g,w,T,M,N,I,R,O,b,P,S,D,L,C,x,G,U,k,B,j,F,Y,V,W,K,X,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,dt,ht;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],d=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],c=t[6]^t[16]^t[26]^t[36]^t[46],l=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(d<<1|h>>>31),r=o^(h<<1|d>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(c<<1|l>>>31),r=u^(l<<1|c>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=d^(f<<1|p>>>31),r=h^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=c^(n<<1|o>>>31),r=l^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,G=t[3]<<1|t[2]>>>31,m=t[13]<<12|t[12]>>>20,E=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,dt=t[42]<<2|t[43]>>>30,ht=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,U=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,I=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,w=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,R=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,M=t[49]<<14|t[48]>>>18,t[0]=v^~m&y,t[1]=_^~E&A,t[10]=N^~R&b,t[11]=I^~O&P,t[20]=x^~U&B,t[21]=G^~k&j,t[30]=K^~z&H,t[31]=X^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=m^~y&g,t[3]=E^~A&w,t[12]=R^~b&S,t[13]=O^~P&D,t[22]=U^~B&F,t[23]=k^~j&Y,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=y^~g&T,t[5]=A^~w&M,t[14]=b^~S&L,t[15]=P^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&dt,t[45]=st^~ut&ht,t[6]=g^~T&v,t[7]=w^~M&_,t[16]=S^~L&N,t[17]=D^~C&I,t[26]=F^~V&x,t[27]=Y^~W&G,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~dt&et,t[47]=ut^~ht&rt,t[8]=T^~v&m,t[9]=M^~_&E,t[18]=L^~N&R,t[19]=C^~I&O,t[28]=V^~x&U,t[29]=W^~G&k,t[38]=Q^~K&z,t[39]=tt^~X&Z,t[48]=dt^~et&it,t[49]=ht^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=d.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(m))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(y(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(y(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},w=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return l.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return h.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),M=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=d.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),h.padZeros(h.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=N.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new M(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new R(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=l.shallowCopy(e)).type=r[1],e=l.deepCopy(e),new G(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new U(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):t,r.push(j(this.coerceFunc,e))}),this),h.hexlify(new U(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?y(t):l.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new U(this.coerceFunc,r,"_").decode(h.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var h={},c=0;c<10;c++)h[String(c)]=String(c);for(c=0;c<26;c++)h[String.fromCharCode(65+c)]=String(10+c);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=h[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=d(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=d("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),d=new o.default.BN(-1);function h(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function c(t){return f(v(t))}function l(t){return new p(h(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(d):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",h(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",h(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",h(c(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",h(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return l(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return l(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},t.prototype.add=function(t){return l(f(this).add(c(t)))},t.prototype.sub=function(t){return l(f(this).sub(c(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(c(t)))},t.prototype.mul=function(t){return l(f(this).mul(c(t)))},t.prototype.mod=function(t){return l(f(this).mod(c(t)))},t.prototype.pow=function(t){return l(f(this).pow(c(t)))},t.prototype.maskn=function(t){return l(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(c(t))},t.prototype.lt=function(t){return f(this).lt(c(t))},t.prototype.lte=function(t){return f(this).lte(c(t))},t.prototype.gt=function(t){return f(this).gt(c(t))},t.prototype.gte=function(t){return f(this).gte(c(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=c[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+c[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(h(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=l,e.hexDataLength=function(t){return h(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return h(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(h(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return l(d([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,d=0;d1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function d(t,e,r,i){var n,o,s,d;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=s.length,d=h,console&&console.warn&&console.warn(d)}return t}function h(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function c(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=h.bind(i);return n.listener=r,i.wrapFn=n,n}function l(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var d=u.length,h=p(u,d);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return l(this,t,!0)},o.prototype.rawListeners=function(t){return l(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},6428:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedger=void 0;const n=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),h=r(8943),c=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),m=r(4583),E=r(5421),y=r(2513),A=r(1999),g=r(1741),w=r(3206),T=r(8661),M=r(195),N=r(8548),I=r(4977),R=r(5289),O=r(1066),b=r(4373),P=r(7877);e.AssetLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),A.default(this,t)}))}getApprovedAccount(t){return i(this,void 0,void 0,(function*(){return w.default(this,t)}))}getAssetAccount(t){return i(this,void 0,void 0,(function*(){return M.default(this,t)}))}getAsset(t){return i(this,void 0,void 0,(function*(){return T.default(this,t)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),I.default(this,t)}))}getCapabilities(){return i(this,void 0,void 0,(function*(){return R.default(this)}))}getInfo(){return i(this,void 0,void 0,(function*(){return O.default(this)}))}getAssetIdAt(t){return i(this,void 0,void 0,(function*(){return N.default(this,t)}))}getAccountAssetIdAt(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),g.default(this,t,e)}))}isApprovedAccount(t,e){return i(this,void 0,void 0,(function*(){return(e=this._provider.encoder.normalizeAddress(e))===(yield w.default(this,t))}))}isTransferable(){return i(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(t,e){return i(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)}))}disapproveAccount(t){return i(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)}))}grantAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),h.default(this,t,o.getBitfieldFromAbilities(e))}))}setAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),p.default(this,t,o.getBitfieldFromAbilities(e))}))}createAsset(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.receiverId);return a.default(this,e,t.id,`0x${t.imprint}`)}))}destroyAsset(t){return i(this,void 0,void 0,(function*(){return d.default(this,t)}))}revokeAbilities(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t,o.getBitfieldFromAbilities(e))}))}revokeAsset(t){return i(this,void 0,void 0,(function*(){return l.default(this,t)}))}transferAsset(t){return i(this,void 0,void 0,(function*(){t.senderId||(t.senderId=this.provider.accountId);const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(t.receiverId)?m.default(this,e,r,t.id):f.default(this,e,r,t.id,t.data)}))}enableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return i(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(t,e){return i(this,void 0,void 0,(function*(){return y.default(this,t,`0x${e.imprint}`)}))}update(t){return i(this,void 0,void 0,(function*(){return E.default(this,t.uriPrefix,t.uriPostfix)}))}approveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!0)}))}disapproveOperator(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),v.default(this,t,!1)}))}isApprovedOperator(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),b.default(this,t,e)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:n.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:n.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(e,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(e,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(e,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),n(r(6428),e),n(r(365),e),n(r(5378),e)},5378:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getBitfieldFromAbilities=void 0;const i=r(2624);e.getBitfieldFromAbilities=function(t){let e=i.bigNumberify(0);return t.forEach((t=>{e=e.add(t)})),e.toHexString()}},365:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.getInterfaceCode=void 0;const i=r(6112);e.getInterfaceCode=function(t){return t==i.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==i.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==i.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":t==i.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},212:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256","bytes32"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xb0e329e4"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},3967:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:h,capabilities:c}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(c||[]).map((t=>s.getInterfaceCode(t))),f={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(a,[e,r,u,d,`0x${h}`,l]).substr(2)}`},p=yield t.post({method:"eth_sendTransaction",params:[f]});return new n.Mutation(t,p.result)}))}},8260:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x9d118770"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},8943:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0ab319e8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},4494:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xf394b6df"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0x20c5429b"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},1463:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279);e.default=function(t,e,r,o,s){return i(this,void 0,void 0,(function*(){const i=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[e,r,o,s].filter((t=>void 0!==t)),d={from:t.provider.accountId,to:t.id,data:i+t.provider.encoder.encodeParameters(a,u).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[d]});return new n.Mutation(t.provider,h.result,t)}))}},7234:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x15ec3b8b"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3016:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","bool"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa22cb465"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5641:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){const r={from:t.provider.accountId,to:t.id,data:"0xbedb86fb"+t.provider.encoder.encodeParameters(o,[!e]).substr(2)},i=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new n.Mutation(t.provider,i.result,t)}))}},4583:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},2513:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["uint256","bytes32"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x0d04c3b8"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},5421:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["string","string"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x89b73ec0"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1999:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=["address","uint256"],s=["bool"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){return Promise.all([n.SuperAssetLedgerAbility.MANAGE_ABILITIES,n.GeneralAssetLedgerAbility.CREATE_ASSET,n.GeneralAssetLedgerAbility.REVOKE_ASSET,n.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,n.GeneralAssetLedgerAbility.UPDATE_ASSET,n.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,n.GeneralAssetLedgerAbility.UPDATE_URI_BASE,n.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>i(this,void 0,void 0,(function*(){const i={to:t.id,data:"0xba00a330"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]?r:-1}))))).then((t=>t.filter((t=>-1!==t)).sort(((t,e)=>t-e)))).catch((e=>(t.provider.log(e),[])))}))}},1741:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","uint256"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x2f745c59"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},3206:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(9512),o=["uint256"],s=["address"];e.default=function(t,e){return i(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x081812fc"+t.provider.encoder.encodeParameters(o,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,i.result)[0]}catch(r){return t.provider.log(r),n.default(t,e)}}))}},195:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x6352211e"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8548:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x4f6ccce7"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},8661:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];e.default=function(t,e){return r(this,void 0,void 0,(function*(){const n=yield Promise.all(i.map((i=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:i.signature+t.provider.encoder.encodeParameters(i.inputTypes,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(i.outputTypes,n.result)[0]}catch(e){return t.provider.log(e),null}})))));return{id:e,uri:n[0],imprint:n[1]?n[1].substr(2):null,schemaId:n[2]?n[2].substr(2):null}}))}},4977:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},5289:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(6112),o=r(365),s=["bytes4"],a=["bool"];e.default=function(t){return i(this,void 0,void 0,(function*(){return Promise.all([n.AssetLedgerCapability.DESTROY_ASSET,n.AssetLedgerCapability.REVOKE_ASSET,n.AssetLedgerCapability.TOGGLE_TRANSFERS,n.AssetLedgerCapability.UPDATE_ASSET].map((e=>i(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(e),i={to:t.id,data:"0x01ffc9a7"+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[i,"latest"]});return t.provider.encoder.decodeParameters(a,n.result)[0]?e:-1}))))).then((t=>t.filter((t=>-1!==t)).sort())).catch((e=>(t.provider.log(e),[])))}))}},1066:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],uriPrefix:e[2],uriPostfix:e[3],supply:e[4]}}))}},4373:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["bool"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xe985e9c5"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0]}catch(e){return t.provider.log(e),null}}))}},7877:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[],n=["bool"];e.default=function(t){return r(this,void 0,void 0,(function*(){try{const e={to:t.id,data:"0xb187bd26"+t.provider.encoder.encodeParameters(i,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(n,r.result)[0]}catch(e){return t.provider.log(e),null}}))}},9512:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["uint256"],n=["address"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x481af3d3"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0]}catch(e){return t.provider.log(e),null}}))}},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class d extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=d},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=d},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},2895:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedger=void 0;const i=r(5291);class n extends i.AssetLedger{}e.AssetLedger=n},7745:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0;var o=r(5291);Object.defineProperty(e,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(e,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(e,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),n(r(2895),e)},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(7745))})(); \ No newline at end of file diff --git a/dist/0xcert-wanchain-gateway.min.js b/dist/0xcert-wanchain-gateway.min.js index 16c111fa0..a157b452e 100644 --- a/dist/0xcert-wanchain-gateway.min.js +++ b/dist/0xcert-wanchain-gateway.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-wanchain-gateway.min.js.LICENSE.txt */ -(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,R=0|s[5],w=8191&R,N=R>>>13,b=0|s[6],M=8191&b,P=b>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,G=0|s[9],U=8191&G,j=G>>>13,F=0|a[0],K=8191&F,B=F>>>13,Y=0|a[1],V=8191&Y,z=Y>>>13,X=0|a[2],H=8191&X,W=X>>>13,Z=0|a[3],$=8191&Z,q=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,K))|0)+((8191&(i=(i=Math.imul(h,B))+Math.imul(l,K)|0))<<13)|0;d=((o=Math.imul(l,B))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,B))+Math.imul(v,K)|0,o=Math.imul(v,B);var Ee=(d+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,V)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,B))+Math.imul(m,K)|0,o=Math.imul(m,B),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,z)|0;var me=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,K),i=(i=Math.imul(A,B))+Math.imul(g,K)|0,o=Math.imul(g,B),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,$)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,B))+Math.imul(T,K)|0,o=Math.imul(T,B),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,z)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,q)|0;var Ae=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,B))+Math.imul(N,K)|0,o=Math.imul(N,B),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var ge=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(M,K),i=(i=Math.imul(M,B))+Math.imul(P,K)|0,o=Math.imul(P,B),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,B))+Math.imul(x,K)|0,o=Math.imul(x,B),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,B))+Math.imul(k,K)|0,o=Math.imul(k,B),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,B))+Math.imul(j,K)|0,o=Math.imul(j,B),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var Re=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,z))+Math.imul(j,V)|0,o=Math.imul(j,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,de)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Ne=(d+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(m,pe)|0))<<13)|0;d=((o=o+Math.imul(m,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var be=(d+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ve)|0)+Math.imul(g,pe)|0))<<13)|0;d=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Me=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(N,pe)|0))<<13)|0;d=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;d=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,ue),i=(i=Math.imul(U,de))+Math.imul(j,ue)|0,o=Math.imul(j,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(U,he),i=(i=Math.imul(U,le))+Math.imul(j,he)|0,o=Math.imul(j,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ve))+Math.imul(j,pe)|0))<<13)|0;return d=((o=Math.imul(j,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=Ee,u[2]=me,u[3]=ye,u[4]=Ae,u[5]=ge,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=Re,u[10]=we,u[11]=Ne,u[12]=be,u[13]=Me,u[14]=Pe,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var E={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(y,m),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(E[e])return E[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new A;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return E[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,O,I,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,K,B,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&O,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&K,e[23]=U^~F&B,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&I,e[5]=A^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~K&Y,e[25]=F^~B&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~I&v,e[7]=O^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=K^~Y&C,e[27]=B^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];E%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new A(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new A(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new A(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}A.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(g(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&g(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var g=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,O,I,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,K,B,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&O,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&K,e[23]=U^~F&B,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&I,e[5]=A^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~K&Y,e[25]=F^~B&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~I&v,e[7]=O^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=K^~Y&C,e[27]=B^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(E))throw new Error('invalid identifier: "'+n[1]+'"');if(U(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var g=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(g),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(g),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=R.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new N(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new G(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var K=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new G(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new G(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=K,t.defaultAbiCoder=new K},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},6428:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const i=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),c=r(8943),h=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),E=r(4583),m=r(5421),y=r(2513),A=r(1999),g=r(1741),O=r(3206),I=r(8661),T=r(195),R=r(8548),w=r(4977),N=r(5289),b=r(1066),M=r(4373),P=r(7877);t.AssetLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getAbilities(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),A.default(this,e)}))}getApprovedAccount(e){return n(this,void 0,void 0,(function*(){return O.default(this,e)}))}getAssetAccount(e){return n(this,void 0,void 0,(function*(){return T.default(this,e)}))}getAsset(e){return n(this,void 0,void 0,(function*(){return I.default(this,e)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),w.default(this,e)}))}getCapabilities(){return n(this,void 0,void 0,(function*(){return N.default(this)}))}getInfo(){return n(this,void 0,void 0,(function*(){return b.default(this)}))}getAssetIdAt(e){return n(this,void 0,void 0,(function*(){return R.default(this,e)}))}getAccountAssetIdAt(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),g.default(this,e,t)}))}isApprovedAccount(e,t){return n(this,void 0,void 0,(function*(){return(t=this._provider.encoder.normalizeAddress(t))===(yield O.default(this,e))}))}isTransferable(){return n(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(e,t){return n(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),s.default(this,t,e)}))}disapproveAccount(e){return n(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",e)}))}grantAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),c.default(this,e,o.getBitfieldFromAbilities(t))}))}setAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),p.default(this,e,o.getBitfieldFromAbilities(t))}))}createAsset(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.receiverId);return a.default(this,t,e.id,`0x${e.imprint}`)}))}destroyAsset(e){return n(this,void 0,void 0,(function*(){return d.default(this,e)}))}revokeAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),h.default(this,e,o.getBitfieldFromAbilities(t))}))}revokeAsset(e){return n(this,void 0,void 0,(function*(){return l.default(this,e)}))}transferAsset(e){return n(this,void 0,void 0,(function*(){e.senderId||(e.senderId=this.provider.accountId);const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(e.receiverId)?E.default(this,t,r,e.id):f.default(this,t,r,e.id,e.data)}))}enableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(e,t){return n(this,void 0,void 0,(function*(){return y.default(this,e,`0x${t.imprint}`)}))}update(e){return n(this,void 0,void 0,(function*(){return m.default(this,e.uriPrefix,e.uriPostfix)}))}approveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!0)}))}disapproveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!1)}))}isApprovedOperator(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),M.default(this,e,t)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:i.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(6428),t),i(r(365),t),i(r(5378),t)},5378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),E=r(8634),m=r(7045),y=r(5636),A=r(6075),g=r(8608),O=r(1785),I=r(7461),T=r(2746),R=r(3924),w=r(5434),N=r(6651),b=r(8453),M=r(9085),P=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),G=r(1399),U=r(9156),j=r(3022),F=r(9669),K=r(7734),B=r(4909),Y=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?b.default(this,e):N.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):j.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),E.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),m.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=Y.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case Y.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=Y.ProxyId.NFTOKEN_TRANSFER);break;case Y.ProxyKind.CREATE_ASSET:t=Y.ProxyId.XCERT_CREATE;break;case Y.ProxyKind.DESTROY_ASSET:t=Y.ProxyId.XCERT_BURN;break;case Y.ProxyKind.MANAGE_ABILITIES:t=Y.ProxyId.MANAGE_ABILITIES;break;case Y.ProxyKind.TRANSFER_TOKEN:t=Y.ProxyId.TOKEN_TRANSFER;break;case Y.ProxyKind.UPDATE_ASSET:t=Y.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return R.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),U.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},2792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const n=r(8344);class i extends n.Gateway{}t.Gateway=i},2086:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyKind=t.AssetLedgerDeployOrder=t.FixedActionsOrder=t.SignedFixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.ActionsOrderActionKind=void 0;var o=r(8344);Object.defineProperty(t,"ActionsOrderActionKind",{enumerable:!0,get:function(){return o.ActionsOrderActionKind}}),Object.defineProperty(t,"DynamicActionsOrder",{enumerable:!0,get:function(){return o.DynamicActionsOrder}}),Object.defineProperty(t,"SignedDynamicActionsOrder",{enumerable:!0,get:function(){return o.SignedDynamicActionsOrder}}),Object.defineProperty(t,"SignedFixedActionsOrder",{enumerable:!0,get:function(){return o.SignedFixedActionsOrder}}),Object.defineProperty(t,"FixedActionsOrder",{enumerable:!0,get:function(){return o.FixedActionsOrder}}),Object.defineProperty(t,"AssetLedgerDeployOrder",{enumerable:!0,get:function(){return o.AssetLedgerDeployOrder}}),Object.defineProperty(t,"ProxyKind",{enumerable:!0,get:function(){return o.ProxyKind}}),i(r(2792),t)},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(2086))})(); \ No newline at end of file +(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,y=0|s[3],A=8191&y,g=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,R=0|s[5],w=8191&R,N=R>>>13,b=0|s[6],M=8191&b,P=b>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,G=0|s[9],U=8191&G,j=G>>>13,F=0|a[0],K=8191&F,B=F>>>13,Y=0|a[1],V=8191&Y,z=Y>>>13,X=0|a[2],H=8191&X,W=X>>>13,Z=0|a[3],$=8191&Z,q=Z>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,K))|0)+((8191&(i=(i=Math.imul(h,B))+Math.imul(l,K)|0))<<13)|0;d=((o=Math.imul(l,B))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,B))+Math.imul(v,K)|0,o=Math.imul(v,B);var Ee=(d+(n=n+Math.imul(h,V)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,V)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(E,K),i=(i=Math.imul(E,B))+Math.imul(m,K)|0,o=Math.imul(m,B),n=n+Math.imul(p,V)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,V)|0,o=o+Math.imul(v,z)|0;var me=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(A,K),i=(i=Math.imul(A,B))+Math.imul(g,K)|0,o=Math.imul(g,B),n=n+Math.imul(E,V)|0,i=(i=i+Math.imul(E,z)|0)+Math.imul(m,V)|0,o=o+Math.imul(m,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,$)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,B))+Math.imul(T,K)|0,o=Math.imul(T,B),n=n+Math.imul(A,V)|0,i=(i=i+Math.imul(A,z)|0)+Math.imul(g,V)|0,o=o+Math.imul(g,z)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,q)|0;var Ae=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,B))+Math.imul(N,K)|0,o=Math.imul(N,B),n=n+Math.imul(I,V)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,V)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var ge=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(M,K),i=(i=Math.imul(M,B))+Math.imul(P,K)|0,o=Math.imul(P,B),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(N,V)|0,o=o+Math.imul(N,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,ee)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,B))+Math.imul(x,K)|0,o=Math.imul(x,B),n=n+Math.imul(M,V)|0,i=(i=i+Math.imul(M,z)|0)+Math.imul(P,V)|0,o=o+Math.imul(P,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(I,$)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,ee)|0,n=n+Math.imul(E,re)|0,i=(i=i+Math.imul(E,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,B))+Math.imul(k,K)|0,o=Math.imul(k,B),n=n+Math.imul(D,V)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,V)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(P,H)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(N,$)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(g,re)|0,o=o+Math.imul(g,ne)|0,n=n+Math.imul(E,oe)|0,i=(i=i+Math.imul(E,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,B))+Math.imul(j,K)|0,o=Math.imul(j,B),n=n+Math.imul(C,V)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,V)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,se)|0)+Math.imul(g,oe)|0,o=o+Math.imul(g,se)|0,n=n+Math.imul(E,ue)|0,i=(i=i+Math.imul(E,de)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var Re=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,V),i=(i=Math.imul(U,z))+Math.imul(j,V)|0,o=Math.imul(j,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,$)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(N,re)|0,o=o+Math.imul(N,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,de)|0)+Math.imul(g,ue)|0,o=o+Math.imul(g,de)|0,n=n+Math.imul(E,he)|0,i=(i=i+Math.imul(E,le)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(U,H),i=(i=Math.imul(U,W))+Math.imul(j,H)|0,o=Math.imul(j,W),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(N,oe)|0,o=o+Math.imul(N,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(A,he)|0,i=(i=i+Math.imul(A,le)|0)+Math.imul(g,he)|0,o=o+Math.imul(g,le)|0;var Ne=(d+(n=n+Math.imul(E,pe)|0)|0)+((8191&(i=(i=i+Math.imul(E,ve)|0)+Math.imul(m,pe)|0))<<13)|0;d=((o=o+Math.imul(m,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,q))+Math.imul(j,$)|0,o=Math.imul(j,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(N,ue)|0,o=o+Math.imul(N,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var be=(d+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ve)|0)+Math.imul(g,pe)|0))<<13)|0;d=((o=o+Math.imul(g,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,ee))+Math.imul(j,Q)|0,o=Math.imul(j,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(M,ue)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(N,he)|0,o=o+Math.imul(N,le)|0;var Me=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(j,re)|0,o=Math.imul(j,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,he)|0,o=o+Math.imul(P,le)|0;var Pe=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(N,pe)|0))<<13)|0;d=((o=o+Math.imul(N,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,se))+Math.imul(j,oe)|0,o=Math.imul(j,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,ve)|0)+Math.imul(P,pe)|0))<<13)|0;d=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,ue),i=(i=Math.imul(U,de))+Math.imul(j,ue)|0,o=Math.imul(j,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(U,he),i=(i=Math.imul(U,le))+Math.imul(j,he)|0,o=Math.imul(j,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ve))+Math.imul(j,pe)|0))<<13)|0;return d=((o=Math.imul(j,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=Ee,u[2]=me,u[3]=ye,u[4]=Ae,u[5]=ge,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=Re,u[10]=we,u[11]=Ne,u[12]=be,u[13]=Me,u[14]=Pe,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var E={k256:null,p224:null,p192:null,p25519:null};function m(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},m.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(e,t){e.iushrn(this.n,0,t)},m.prototype.imulK=function(e){return e.imul(this.k)},i(y,m),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(E[e])return E[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new A;else if("p192"===e)t=new g;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return E[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,O,I,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,K,B,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&O,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&K,e[23]=U^~F&B,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&I,e[5]=A^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~K&Y,e[25]=F^~B&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~I&v,e[7]=O^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=K^~Y&C,e[27]=B^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];E%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new A(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new A(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new A(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}A.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(g(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&g(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var g=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,E,m,y,A,g,O,I,T,R,w,N,b,M,P,S,D,x,L,C,k,G,U,j,F,K,B,Y,V,z,X,H,W,Z,$,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,M=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,Y=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,E=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Z=e[22]<<10|e[23]>>>22,$=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,G=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,A=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,j=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,g=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,N=e[18]<<20|e[19]>>>12,b=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~E&y,e[1]=_^~m&A,e[10]=R^~N&M,e[11]=w^~b&P,e[20]=C^~G&j,e[21]=k^~U&F,e[30]=z^~H&Z,e[31]=X^~W&$,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=E^~y&g,e[3]=m^~A&O,e[12]=N^~M&S,e[13]=b^~P&D,e[22]=G^~j&K,e[23]=U^~F&B,e[32]=H^~Z&q,e[33]=W^~$&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~g&I,e[5]=A^~O&T,e[14]=M^~S&x,e[15]=P^~D&L,e[24]=j^~K&Y,e[25]=F^~B&V,e[34]=Z^~q&Q,e[35]=$^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=g^~I&v,e[7]=O^~T&_,e[16]=S^~x&R,e[17]=D^~L&w,e[26]=K^~Y&C,e[27]=B^~V&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&E,e[9]=T^~_&m,e[18]=x^~R&N,e[19]=L^~w&b,e[28]=Y^~C&G,e[29]=V^~k&U,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(E))throw new Error('invalid identifier: "'+n[1]+'"');if(U(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var g=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(g),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(g),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=R.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new N(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new G(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var K=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new G(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new G(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=K,t.defaultAbiCoder=new K},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},6428:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const i=r(3279),o=r(5291),s=r(877),a=r(212),u=r(3967),d=r(8260),c=r(8943),h=r(4494),l=r(3583),f=r(1463),p=r(7234),v=r(3016),_=r(5641),E=r(4583),m=r(5421),y=r(2513),A=r(1999),g=r(1741),O=r(3206),I=r(8661),T=r(195),R=r(8548),w=r(4977),N=r(5289),b=r(1066),M=r(4373),P=r(7877);t.AssetLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getAbilities(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),A.default(this,e)}))}getApprovedAccount(e){return n(this,void 0,void 0,(function*(){return O.default(this,e)}))}getAssetAccount(e){return n(this,void 0,void 0,(function*(){return T.default(this,e)}))}getAsset(e){return n(this,void 0,void 0,(function*(){return I.default(this,e)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),w.default(this,e)}))}getCapabilities(){return n(this,void 0,void 0,(function*(){return N.default(this)}))}getInfo(){return n(this,void 0,void 0,(function*(){return b.default(this)}))}getAssetIdAt(e){return n(this,void 0,void 0,(function*(){return R.default(this,e)}))}getAccountAssetIdAt(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),g.default(this,e,t)}))}isApprovedAccount(e,t){return n(this,void 0,void 0,(function*(){return(t=this._provider.encoder.normalizeAddress(t))===(yield O.default(this,e))}))}isTransferable(){return n(this,void 0,void 0,(function*(){return P.default(this)}))}approveAccount(e,t){return n(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),s.default(this,t,e)}))}disapproveAccount(e){return n(this,void 0,void 0,(function*(){return s.default(this,"0x0000000000000000000000000000000000000000",e)}))}grantAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),c.default(this,e,o.getBitfieldFromAbilities(t))}))}setAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),p.default(this,e,o.getBitfieldFromAbilities(t))}))}createAsset(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.receiverId);return a.default(this,t,e.id,`0x${e.imprint}`)}))}destroyAsset(e){return n(this,void 0,void 0,(function*(){return d.default(this,e)}))}revokeAbilities(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),h.default(this,e,o.getBitfieldFromAbilities(t))}))}revokeAsset(e){return n(this,void 0,void 0,(function*(){return l.default(this,e)}))}transferAsset(e){return n(this,void 0,void 0,(function*(){e.senderId||(e.senderId=this.provider.accountId);const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return-1!==this.provider.unsafeRecipientIds.indexOf(e.receiverId)?E.default(this,t,r,e.id):f.default(this,t,r,e.id,e.data)}))}enableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!0)}))}disableTransfers(){return n(this,void 0,void 0,(function*(){return _.default(this,!1)}))}updateAsset(e,t){return n(this,void 0,void 0,(function*(){return y.default(this,e,`0x${t.imprint}`)}))}update(e){return n(this,void 0,void 0,(function*(){return m.default(this,e.uriPrefix,e.uriPostfix)}))}approveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!0)}))}disapproveOperator(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),v.default(this,e,!1)}))}isApprovedOperator(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),M.default(this,e,t)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"approved",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"}]},{name:"ApprovalForAll",topic:"0x17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"operator",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"approved",type:"bool"}]},{name:"IsPaused",topic:"0xff4a5dbbab6b1963d10f5edd139f33a7987ecb3c4f65969be77ddba28d946594",types:[{kind:i.MutationEventTypeKind.NORMAL,name:"isPaused",type:"bool"}]},{name:"TokenImprintUpdate",topic:"0xda81dc3bdaf65b621535dbd08fc4032c7e22d5ccab12c8aa2ad010611471d627",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"tokenId",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"imprint",type:"bytes32"}]},{name:"SetAbilities",topic:"0xd1d59d2d212a435434e7a4a4676427610dfe2b6268b01e541d280d65bf3d6b90",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"target",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"abilities",type:"uint256"}]}]}}},5291:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(6112);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(6428),t),i(r(365),t),i(r(5378),t)},5378:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),E=r(8634),m=r(7045),y=r(5636),A=r(6075),g=r(8608),O=r(1785),I=r(7461),T=r(2746),R=r(3924),w=r(5434),N=r(6651),b=r(8453),M=r(9085),P=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),G=r(1399),U=r(9156),j=r(3022),F=r(9669),K=r(7734),B=r(4909),Y=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?b.default(this,e):N.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):j.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),E.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),m.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=Y.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case Y.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=Y.ProxyId.NFTOKEN_TRANSFER);break;case Y.ProxyKind.CREATE_ASSET:t=Y.ProxyId.XCERT_CREATE;break;case Y.ProxyKind.DESTROY_ASSET:t=Y.ProxyId.XCERT_BURN;break;case Y.ProxyKind.MANAGE_ABILITIES:t=Y.ProxyId.MANAGE_ABILITIES;break;case Y.ProxyKind.TRANSFER_TOKEN:t=Y.ProxyId.TOKEN_TRANSFER;break;case Y.ProxyKind.UPDATE_ASSET:t=Y.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return R.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),U.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},2792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const n=r(8344);class i extends n.Gateway{}t.Gateway=i},2086:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyKind=t.AssetLedgerDeployOrder=t.FixedActionsOrder=t.SignedFixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.ActionsOrderActionKind=void 0;var o=r(8344);Object.defineProperty(t,"ActionsOrderActionKind",{enumerable:!0,get:function(){return o.ActionsOrderActionKind}}),Object.defineProperty(t,"DynamicActionsOrder",{enumerable:!0,get:function(){return o.DynamicActionsOrder}}),Object.defineProperty(t,"SignedDynamicActionsOrder",{enumerable:!0,get:function(){return o.SignedDynamicActionsOrder}}),Object.defineProperty(t,"SignedFixedActionsOrder",{enumerable:!0,get:function(){return o.SignedFixedActionsOrder}}),Object.defineProperty(t,"FixedActionsOrder",{enumerable:!0,get:function(){return o.FixedActionsOrder}}),Object.defineProperty(t,"AssetLedgerDeployOrder",{enumerable:!0,get:function(){return o.AssetLedgerDeployOrder}}),Object.defineProperty(t,"ProxyKind",{enumerable:!0,get:function(){return o.ProxyKind}}),i(r(2792),t)},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(2086))})(); \ No newline at end of file diff --git a/dist/0xcert-wanchain-http-provider.min.js b/dist/0xcert-wanchain-http-provider.min.js index 1dc063c1a..e4948e978 100644 --- a/dist/0xcert-wanchain-http-provider.min.js +++ b/dist/0xcert-wanchain-http-provider.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-wanchain-http-provider.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var _=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?_+r:l[h-_.length]+_+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,_=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,g=0|s[3],A=8191&g,y=g>>>13,M=0|s[4],N=8191&M,T=M>>>13,w=0|s[5],R=8191&w,O=w>>>13,I=0|s[6],b=8191&I,S=I>>>13,P=0|s[7],D=8191&P,L=P>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],Z=8191&X,H=X>>>13,z=0|a[3],q=8191&z,$=z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,_t=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,Y))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,Y))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(_,F)|0,o=Math.imul(_,Y);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,K)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,K)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,Y))+Math.imul(m,F)|0,o=Math.imul(m,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,K)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,H)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(y,F)|0,o=Math.imul(y,Y),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,K)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,H)|0;var gt=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,Y))+Math.imul(T,F)|0,o=Math.imul(T,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,K)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,H)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0;var At=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,Y))+Math.imul(O,F)|0,o=Math.imul(O,Y),i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,K)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(S,F)|0,o=Math.imul(S,Y),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,K)|0,i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,H)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,H)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0;var Mt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,K)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,H)|0,i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0;var Nt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(U,F)|0,o=Math.imul(U,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,K)|0,i=i+Math.imul(D,Z)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,H)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(_,dt)|0,o=o+Math.imul(_,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,_t)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,_t)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,H)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,_t)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,_t)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,Z),n=(n=Math.imul(k,H))+Math.imul(B,Z)|0,o=Math.imul(B,H),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(A,dt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var Ot=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,_t)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,_t)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(N,dt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var It=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,_t)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,_t)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(O,dt)|0,o=o+Math.imul(O,ct)|0;var bt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,_t)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,_t)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,_t)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,_t)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(D,dt)|0,n=(n=n+Math.imul(D,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Pt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,_t)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,_t)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Dt=(h+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,_t)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,_t)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,_t)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,_t)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,_t))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,_t))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=gt,u[4]=At,u[5]=yt,u[6]=Mt,u[7]=Nt,u[8]=Tt,u[9]=wt,u[10]=Rt,u[11]=Ot,u[12]=It,u[13]=bt,u[14]=St,u[15]=Pt,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function _(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):_(this,t,e)},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,_=1;0==(r.words[0]&_)&&p<26;++p,_<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new N(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){N.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(g,m),g.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new A;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return E[t]=e,e},N.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},N.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},N.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},N.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},N.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},N.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},N.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},N.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},N.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},N.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},N.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},N.prototype.isqr=function(t){return this.imul(t,t.clone())},N.prototype.sqr=function(t){return this.mul(t,t)},N.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var _=f,v=0;0!==_.cmp(a);v++)_=_.redSqr();i(v=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},N.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},N.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,N),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,_,v,E,m,g,A,y,M,N,T,w,R,O,I,b,S,P,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,O=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,N=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=w^~O&b,t[11]=R^~I&S,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~Z&z,t[31]=X^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=O^~b&P,t[13]=I^~S&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=g^~y&N,t[5]=A^~M&T,t[14]=b^~P&L,t[15]=S^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~N&_,t[7]=M^~T&v,t[16]=P^~L&w,t[17]=D^~C&R,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=N^~_&E,t[9]=T^~v&m,t[18]=L^~w&O,t[19]=C^~R&I,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&Z,t[39]=tt^~X&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[v>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=v-h,t.block=u[l],v=0;v>2]|=r[3&v],t.lastByteIndex===h)for(u[0]=u[l],v=1;v>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),v=0)}return"0x"+_})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,_,v,E,m,g,A,y,M,N,T,w,R,O,I,b,S,P,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,O=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,N=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=w^~O&b,t[11]=R^~I&S,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~Z&z,t[31]=X^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=O^~b&P,t[13]=I^~S&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=g^~y&N,t[5]=A^~M&T,t[14]=b^~P&L,t[15]=S^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~N&_,t[7]=M^~T&v,t[16]=P^~L&w,t[17]=D^~C&R,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=N^~_&E,t[9]=T^~v&m,t[18]=L^~w&O,t[19]=C^~R&I,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&Z,t[39]=tt^~X&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(_=0;_2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(g(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(g(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),N=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new O(t,n,e.name);if(r=e.type.match(_)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new N(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?g(t):t,r.push(j(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?g(t):c.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function _(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=_,e.getIcapAddress=function(t){for(var e=new n.default.BN(_(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return _("0x"+s.keccak256(a.encode([_(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=_(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),_("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(_(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return _(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function _(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=_},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&_(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},976:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6531);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x8a85cA5ED516DA0f235647222e89CEfeF85F53e4",assetLedgerDeployOrderId:"0x20337208647bB73b706D435c86F31cd5897bB24c",valueLedgerDeployOrderId:"0x9a0bB454D50c7281562cD75311412E1a7D1375AF"};case i.NetworkKind.TESTNET:return{actionsOrderId:"0x7b65B89Dd2b43229E8BD087fA1601805d571b57D",assetLedgerDeployOrderId:"0x121ab5e82cdA136e4632268956d4227696D2F5e7",valueLedgerDeployOrderId:"0xE18a943ab808B69A5da445de844932f5f267baA0"};default:throw new Error("Unsupported network kind.")}}},8279:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const i=r(3279),n=r(9406);class o extends i.GenericProvider{constructor(t){super(Object.assign({encoder:void 0!==t.encoder?t.encoder:new n.Encoder,assetLedgerSource:t.assetLedgerSource||"https://conventions.0xcert.org/wanchain/xcert-mock.json",valueLedgerSource:t.valueLedgerSource||"https://conventions.0xcert.org/wanchain/token-mock.json"},t))}}e.GenericProvider=o},6531:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=void 0,(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.TESTNET=1]="TESTNET"},5411:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=e.MutationEventTypeKind=e.MutationEvent=e.MutationStatus=e.Mutation=e.SignMethod=void 0;var o=r(3279);Object.defineProperty(e,"SignMethod",{enumerable:!0,get:function(){return o.SignMethod}}),Object.defineProperty(e,"Mutation",{enumerable:!0,get:function(){return o.Mutation}}),Object.defineProperty(e,"MutationStatus",{enumerable:!0,get:function(){return o.MutationStatus}}),Object.defineProperty(e,"MutationEvent",{enumerable:!0,get:function(){return o.MutationEvent}}),Object.defineProperty(e,"MutationEventTypeKind",{enumerable:!0,get:function(){return o.MutationEventTypeKind}}),Object.defineProperty(e,"parseError",{enumerable:!0,get:function(){return o.parseError}}),n(r(8279),e),n(r(6531),e),n(r(976),e)},741:function(t,e,r){"use strict";var i=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);nt)).then((t=>e(null,t))).catch((t=>e(t,null)))}}e.HttpProvider=s},5:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(5411),e),n(r(741),e)},9406:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(1793),e)},1793:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?t.toLowerCase():null}}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var _=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?_+r:l[h-_.length]+_+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,_=f>>>13,v=0|s[2],E=8191&v,m=v>>>13,g=0|s[3],A=8191&g,y=g>>>13,M=0|s[4],N=8191&M,T=M>>>13,w=0|s[5],R=8191&w,O=w>>>13,I=0|s[6],b=8191&I,S=I>>>13,P=0|s[7],D=8191&P,L=P>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,j=0|a[0],F=8191&j,Y=j>>>13,V=0|a[1],W=8191&V,K=V>>>13,X=0|a[2],Z=8191&X,H=X>>>13,z=0|a[3],q=8191&z,$=z>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,_t=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(i=Math.imul(d,F))|0)+((8191&(n=(n=Math.imul(d,Y))+Math.imul(c,F)|0))<<13)|0;h=((o=Math.imul(c,Y))+(n>>>13)|0)+(vt>>>26)|0,vt&=67108863,i=Math.imul(p,F),n=(n=Math.imul(p,Y))+Math.imul(_,F)|0,o=Math.imul(_,Y);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,K)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,K)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,F),n=(n=Math.imul(E,Y))+Math.imul(m,F)|0,o=Math.imul(m,Y),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,K)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,K)|0;var mt=(h+(i=i+Math.imul(d,Z)|0)|0)+((8191&(n=(n=n+Math.imul(d,H)|0)+Math.imul(c,Z)|0))<<13)|0;h=((o=o+Math.imul(c,H)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(A,F),n=(n=Math.imul(A,Y))+Math.imul(y,F)|0,o=Math.imul(y,Y),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,K)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,K)|0,i=i+Math.imul(p,Z)|0,n=(n=n+Math.imul(p,H)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,H)|0;var gt=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(N,F),n=(n=Math.imul(N,Y))+Math.imul(T,F)|0,o=Math.imul(T,Y),i=i+Math.imul(A,W)|0,n=(n=n+Math.imul(A,K)|0)+Math.imul(y,W)|0,o=o+Math.imul(y,K)|0,i=i+Math.imul(E,Z)|0,n=(n=n+Math.imul(E,H)|0)+Math.imul(m,Z)|0,o=o+Math.imul(m,H)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,$)|0;var At=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(R,F),n=(n=Math.imul(R,Y))+Math.imul(O,F)|0,o=Math.imul(O,Y),i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,K)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,K)|0,i=i+Math.imul(A,Z)|0,n=(n=n+Math.imul(A,H)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,H)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0;var yt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(b,F),n=(n=Math.imul(b,Y))+Math.imul(S,F)|0,o=Math.imul(S,Y),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,K)|0)+Math.imul(O,W)|0,o=o+Math.imul(O,K)|0,i=i+Math.imul(N,Z)|0,n=(n=n+Math.imul(N,H)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,H)|0,i=i+Math.imul(A,q)|0,n=(n=n+Math.imul(A,$)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,it)|0;var Mt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(D,F),n=(n=Math.imul(D,Y))+Math.imul(L,F)|0,o=Math.imul(L,Y),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,K)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,K)|0,i=i+Math.imul(R,Z)|0,n=(n=n+Math.imul(R,H)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,H)|0,i=i+Math.imul(N,q)|0,n=(n=n+Math.imul(N,$)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,$)|0,i=i+Math.imul(A,Q)|0,n=(n=n+Math.imul(A,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0;var Nt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(x,F),n=(n=Math.imul(x,Y))+Math.imul(U,F)|0,o=Math.imul(U,Y),i=i+Math.imul(D,W)|0,n=(n=n+Math.imul(D,K)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,K)|0,i=i+Math.imul(b,Z)|0,n=(n=n+Math.imul(b,H)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,H)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,$)|0,i=i+Math.imul(N,Q)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(A,rt)|0,n=(n=n+Math.imul(A,it)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(_,ut)|0,o=o+Math.imul(_,ht)|0;var Tt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(k,F),n=(n=Math.imul(k,Y))+Math.imul(B,F)|0,o=Math.imul(B,Y),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,K)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,K)|0,i=i+Math.imul(D,Z)|0,n=(n=n+Math.imul(D,H)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,H)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(S,q)|0,o=o+Math.imul(S,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,i=i+Math.imul(N,rt)|0,n=(n=n+Math.imul(N,it)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,it)|0,i=i+Math.imul(A,ot)|0,n=(n=n+Math.imul(A,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(_,dt)|0,o=o+Math.imul(_,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,_t)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,_t)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,K))+Math.imul(B,W)|0,o=Math.imul(B,K),i=i+Math.imul(x,Z)|0,n=(n=n+Math.imul(x,H)|0)+Math.imul(U,Z)|0,o=o+Math.imul(U,H)|0,i=i+Math.imul(D,q)|0,n=(n=n+Math.imul(D,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,it)|0,i=i+Math.imul(N,ot)|0,n=(n=n+Math.imul(N,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,i=i+Math.imul(A,ut)|0,n=(n=n+Math.imul(A,ht)|0)+Math.imul(y,ut)|0,o=o+Math.imul(y,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,_t)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,_t)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,Z),n=(n=Math.imul(k,H))+Math.imul(B,Z)|0,o=Math.imul(B,H),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(D,Q)|0,n=(n=n+Math.imul(D,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,i=i+Math.imul(N,ut)|0,n=(n=n+Math.imul(N,ht)|0)+Math.imul(T,ut)|0,o=o+Math.imul(T,ht)|0,i=i+Math.imul(A,dt)|0,n=(n=n+Math.imul(A,ct)|0)+Math.imul(y,dt)|0,o=o+Math.imul(y,ct)|0;var Ot=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,_t)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,_t)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(D,rt)|0,n=(n=n+Math.imul(D,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(O,ut)|0,o=o+Math.imul(O,ht)|0,i=i+Math.imul(N,dt)|0,n=(n=n+Math.imul(N,ct)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,ct)|0;var It=(h+(i=i+Math.imul(A,pt)|0)|0)+((8191&(n=(n=n+Math.imul(A,_t)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,_t)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(D,ot)|0,n=(n=n+Math.imul(D,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(S,ut)|0,o=o+Math.imul(S,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(O,dt)|0,o=o+Math.imul(O,ct)|0;var bt=(h+(i=i+Math.imul(N,pt)|0)|0)+((8191&(n=(n=n+Math.imul(N,_t)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,_t)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(D,ut)|0,n=(n=n+Math.imul(D,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(S,dt)|0,o=o+Math.imul(S,ct)|0;var St=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,_t)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,_t)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(D,dt)|0,n=(n=n+Math.imul(D,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Pt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,_t)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,_t)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var Dt=(h+(i=i+Math.imul(D,pt)|0)|0)+((8191&(n=(n=n+Math.imul(D,_t)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,_t)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,_t)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,_t)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,_t))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,_t))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=vt,u[1]=Et,u[2]=mt,u[3]=gt,u[4]=At,u[5]=yt,u[6]=Mt,u[7]=Nt,u[8]=Tt,u[9]=wt,u[10]=Rt,u[11]=Ot,u[12]=It,u[13]=bt,u[14]=St,u[15]=Pt,u[16]=Dt,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function _(t,e,r){return(new v).mulp(t,e,r)}function v(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):_(this,t,e),r},v.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},v.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,_=1;0==(r.words[0]&_)&&p<26;++p,_<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new N(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function g(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function y(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function N(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function T(t){N.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(g,m),g.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},g.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new A;else if("p192"===t)e=new y;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return E[t]=e,e},N.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},N.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},N.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},N.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},N.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},N.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},N.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},N.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},N.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},N.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},N.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},N.prototype.isqr=function(t){return this.imul(t,t.clone())},N.prototype.sqr=function(t){return this.mul(t,t)},N.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var _=f,v=0;0!==_.cmp(a);v++)_=_.redSqr();i(v=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},N.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},N.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new T(t)},n(T,N),T.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},T.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},T.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,_,v,E,m,g,A,y,M,N,T,w,R,O,I,b,S,P,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,O=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,N=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=w^~O&b,t[11]=R^~I&S,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~Z&z,t[31]=X^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=O^~b&P,t[13]=I^~S&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=g^~y&N,t[5]=A^~M&T,t[14]=b^~P&L,t[15]=S^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~N&_,t[7]=M^~T&v,t[16]=P^~L&w,t[17]=D^~C&R,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=N^~_&E,t[9]=T^~v&m,t[18]=L^~w&O,t[19]=C^~R&I,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&Z,t[39]=tt^~X&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[v>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=v-h,t.block=u[l],v=0;v>2]|=r[3&v],t.lastByteIndex===h)for(u[0]=u[l],v=1;v>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),v=0)}return"0x"+_})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new A(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new A(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new A(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}A.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(y(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},A.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&y(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var y=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,_,v,E,m,g,A,y,M,N,T,w,R,O,I,b,S,P,D,L,C,x,U,G,k,B,j,F,Y,V,W,K,X,Z,H,z,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,_=t[0],v=t[1],Z=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,z=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,P=t[33]<<13|t[32]>>>19,D=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,g=t[25]<<11|t[24]>>>21,A=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,j=t[27]<<25|t[26]>>>7,y=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,K=t[8]<<27|t[9]>>>5,X=t[9]<<27|t[8]>>>5,O=t[18]<<20|t[19]>>>12,I=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,F=t[38]<<8|t[39]>>>24,Y=t[39]<<8|t[38]>>>24,N=t[48]<<14|t[49]>>>18,T=t[49]<<14|t[48]>>>18,t[0]=_^~E&g,t[1]=v^~m&A,t[10]=w^~O&b,t[11]=R^~I&S,t[20]=x^~G&B,t[21]=U^~k&j,t[30]=K^~Z&z,t[31]=X^~H&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~g&y,t[3]=m^~A&M,t[12]=O^~b&P,t[13]=I^~S&D,t[22]=G^~B&F,t[23]=k^~j&Y,t[32]=Z^~z&$,t[33]=H^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=g^~y&N,t[5]=A^~M&T,t[14]=b^~P&L,t[15]=S^~D&C,t[24]=B^~F&V,t[25]=j^~Y&W,t[34]=z^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=y^~N&_,t[7]=M^~T&v,t[16]=P^~L&w,t[17]=D^~C&R,t[26]=F^~V&x,t[27]=Y^~W&U,t[36]=$^~Q&K,t[37]=J^~tt&X,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=N^~_&E,t[9]=T^~v&m,t[18]=L^~w&O,t[19]=C^~R&I,t[28]=V^~x&G,t[29]=W^~U&k,t[38]=Q^~K&Z,t[39]=tt^~X&H,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(_=0;_2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(v);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(g(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(v);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(g(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var y=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(y),N=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(y),T=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new O(t,n,e.name);if(r=e.type.match(_)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,j(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(j(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new N(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?g(t):t,r.push(j(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?g(t):c.deepCopy(t),r.push(j(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function _(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=_,e.getIcapAddress=function(t){for(var e=new n.default.BN(_(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return _("0x"+s.keccak256(a.encode([_(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=_(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),_("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(_(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return _(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function _(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=_},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}_(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&_(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},976:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6531);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x8a85cA5ED516DA0f235647222e89CEfeF85F53e4",assetLedgerDeployOrderId:"0x20337208647bB73b706D435c86F31cd5897bB24c",valueLedgerDeployOrderId:"0x9a0bB454D50c7281562cD75311412E1a7D1375AF"};case i.NetworkKind.TESTNET:return{actionsOrderId:"0x7b65B89Dd2b43229E8BD087fA1601805d571b57D",assetLedgerDeployOrderId:"0x121ab5e82cdA136e4632268956d4227696D2F5e7",valueLedgerDeployOrderId:"0xE18a943ab808B69A5da445de844932f5f267baA0"};default:throw new Error("Unsupported network kind.")}}},8279:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const i=r(3279),n=r(9406);class o extends i.GenericProvider{constructor(t){super(Object.assign({encoder:void 0!==t.encoder?t.encoder:new n.Encoder,assetLedgerSource:t.assetLedgerSource||"https://conventions.0xcert.org/wanchain/xcert-mock.json",valueLedgerSource:t.valueLedgerSource||"https://conventions.0xcert.org/wanchain/token-mock.json"},t))}}e.GenericProvider=o},6531:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=void 0,(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.TESTNET=1]="TESTNET"},5411:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=e.MutationEventTypeKind=e.MutationEvent=e.MutationStatus=e.Mutation=e.SignMethod=void 0;var o=r(3279);Object.defineProperty(e,"SignMethod",{enumerable:!0,get:function(){return o.SignMethod}}),Object.defineProperty(e,"Mutation",{enumerable:!0,get:function(){return o.Mutation}}),Object.defineProperty(e,"MutationStatus",{enumerable:!0,get:function(){return o.MutationStatus}}),Object.defineProperty(e,"MutationEvent",{enumerable:!0,get:function(){return o.MutationEvent}}),Object.defineProperty(e,"MutationEventTypeKind",{enumerable:!0,get:function(){return o.MutationEventTypeKind}}),Object.defineProperty(e,"parseError",{enumerable:!0,get:function(){return o.parseError}}),n(r(8279),e),n(r(6531),e),n(r(976),e)},741:function(t,e,r){"use strict";var i=this&&this.__rest||function(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var n=0;for(i=Object.getOwnPropertySymbols(t);nt)).then((t=>e(null,t))).catch((t=>e(t,null)))}}e.HttpProvider=s},5:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(5411),e),n(r(741),e)},9406:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(1793),e)},1793:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?t.toLowerCase():null}}},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(5))})(); \ No newline at end of file diff --git a/dist/0xcert-wanchain-value-ledger.min.js b/dist/0xcert-wanchain-value-ledger.min.js index 537bc0bf1..7bd699e92 100644 --- a/dist/0xcert-wanchain-value-ledger.min.js +++ b/dist/0xcert-wanchain-value-ledger.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-wanchain-value-ledger.min.js.LICENSE.txt */ -(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:l[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,A=0|s[3],y=8191&A,g=A>>>13,M=0|s[4],T=8191&M,N=M>>>13,w=0|s[5],R=8191&w,I=w>>>13,O=0|s[6],b=8191&O,P=O>>>13,D=0|s[7],S=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|a[0],j=8191&F,V=F>>>13,Y=0|a[1],W=8191&Y,X=Y>>>13,K=0|a[2],z=8191&K,Z=K>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(h+(i=Math.imul(d,j))|0)+((8191&(n=(n=Math.imul(d,V))+Math.imul(c,j)|0))<<13)|0;h=((o=Math.imul(c,V))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,V))+Math.imul(v,j)|0,o=Math.imul(v,V);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,V))+Math.imul(m,j)|0,o=Math.imul(m,V),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,X)|0;var mt=(h+(i=i+Math.imul(d,z)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(c,z)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(y,j),n=(n=Math.imul(y,V))+Math.imul(g,j)|0,o=Math.imul(g,V),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,V))+Math.imul(N,j)|0,o=Math.imul(N,V),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var yt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(R,j),n=(n=Math.imul(R,V))+Math.imul(I,j)|0,o=Math.imul(I,V),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(y,z)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,V))+Math.imul(P,j)|0,o=Math.imul(P,V),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,Z)|0,i=i+Math.imul(y,q)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var Mt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(S,j),n=(n=Math.imul(S,V))+Math.imul(L,j)|0,o=Math.imul(L,V),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(R,z)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,V))+Math.imul(U,j)|0,o=Math.imul(U,V),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var Nt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,V))+Math.imul(B,j)|0,o=Math.imul(B,V),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,vt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,vt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,i=i+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(y,dt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(g,dt)|0,o=o+Math.imul(g,ct)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,vt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(T,dt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,ct)|0;var Ot=(h+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(P,dt)|0,o=o+Math.imul(P,ct)|0;var Pt=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(S,dt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var St=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=Et,u[2]=mt,u[3]=At,u[4]=yt,u[5]=gt,u[6]=Mt,u[7]=Tt,u[8]=Nt,u[9]=wt,u[10]=Rt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=Dt,u[16]=St,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?p(this,t,e):r<63?f(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e)},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function N(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new y;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return E[t]=e,e},T.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new N(t)},n(N,T),N.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},N.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},N.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},N.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,M,T,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&M,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&T,t[5]=y^~M&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~T&v,t[7]=M^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=T^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=_-h,t.block=u[l],_=0;_>2]|=r[3&_],t.lastByteIndex===h)for(u[0]=u[l],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new y(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new y(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new y(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}y.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},y.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,M,T,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&M,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&T,t[5]=y^~M&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~T&v,t[7]=M^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=T^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),N=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new N(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(v(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8218:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedger=void 0;const n=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),h=r(6512),l=r(7061),d=r(3919),c=r(8926),f=r(2328);e.ValueLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),d.default(this,t,e)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t)}))}getInfo(){return i(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(t,e,r){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const i=yield d.default(this,e,r);return o.bigNumberify(i).gte(o.bigNumberify(t))}))}approveValue(t,e){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!o.bigNumberify(t).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,e,t)}))}disapproveValue(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),a.default(this,t,"0")}))}transferValue(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?l.default(this,e,r,t.value):h.default(this,r,t.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8218),e)},646:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1225:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:a,supply:u}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.valueLedgerSource)).TokenMock.evm.bytecode.object,h={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(s,[e,r,a,u]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[h]});return new n.Mutation(t,l.result)}))}},7061:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},6512:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa9059cbb"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3919:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xdd62ed3e"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},8926:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},2328:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}}))}},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1277:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedger=void 0;const i=r(5508);class n extends i.ValueLedger{}e.ValueLedger=n},765:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(1277),e)},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(765))})(); \ No newline at end of file +(()=>{var t={1303:function(t,e,r){!function(t,e){"use strict";function i(t,e){if(!t)throw new Error(e||"Assertion failed")}function n(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function o(t,e,r){if(o.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&("le"!==e&&"be"!==e||(r=e,e=10),this._init(t||0,e||10,r||"be"))}var s;"object"==typeof t?t.exports=o:e.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(t){}function a(t,e){var r=t.charCodeAt(e);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(t,e,r){var i=a(t,r);return r-1>=e&&(i|=a(t,r-1)<<4),i}function h(t,e,r,i){for(var n=0,o=Math.min(t.length,r),s=e;s=49?a-49+10:a>=17?a-17+10:a}return n}o.isBN=function(t){return t instanceof o||null!==t&&"object"==typeof t&&t.constructor.wordSize===o.wordSize&&Array.isArray(t.words)},o.max=function(t,e){return t.cmp(e)>0?t:e},o.min=function(t,e){return t.cmp(e)<0?t:e},o.prototype._init=function(t,e,r){if("number"==typeof t)return this._initNumber(t,e,r);if("object"==typeof t)return this._initArray(t,e,r);"hex"===e&&(e=16),i(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(n=0,o=0;n>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var i=0;i=e;i-=2)n=u(t,e,i)<=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,a=Math.min(o,o-s)+r,u=0,l=r;l1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],c=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var h=1;h>>26,d=67108863&u,c=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=c;f++){var p=h-f|0;l+=(s=(n=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[h]=0|d,u=0|l}return 0!==u?r.words[h]=0|u:r.length--,r.strip()}o.prototype.toString=function(t,e){var r;if(e=0|e||1,16===(t=t||10)||"hex"===t){r="";for(var n=0,o=0,s=0;s>>24-n&16777215)||s!==this.length-1?l[6-u.length]+u+r:u+r,(n+=2)>=26&&(n-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(t===(0|t)&&t>=2&&t<=36){var h=d[t],f=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(t);r=(p=p.idivn(f)).isZero()?v+r:l[h-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}i(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&i(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(t,e){return i(void 0!==s),this.toArrayLike(s,t,e)},o.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},o.prototype.toArrayLike=function(t,e,r){var n=this.byteLength(),o=r||Math.max(1,n);i(n<=o,"byte array longer than desired length"),i(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===e,h=new t(o),l=this.clone();if(u){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),h[a]=s;for(;a=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},o.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 0==(8191&e)&&(r+=13,e>>>=13),0==(127&e)&&(r+=7,e>>>=7),0==(15&e)&&(r+=4,e>>>=4),0==(3&e)&&(r+=2,e>>>=2),0==(1&e)&&r++,r},o.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return 26*(this.length-1)+e},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},o.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},o.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},o.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},o.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},o.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},o.prototype.inotn=function(t){i("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){i("number"==typeof t&&t>=0);var r=t/26|0,n=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,i=t):(r=t,i=this);for(var n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},o.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e=this.iadd(t);return t.negative=1,e._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var r,i,n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(r=this,i=t):(r=t,i=this);for(var o=0,s=0;s>26,this.words[s]=67108863&e;for(;0!==o&&s>26,this.words[s]=67108863&e;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],E=8191&_,m=_>>>13,A=0|s[3],y=8191&A,g=A>>>13,M=0|s[4],T=8191&M,N=M>>>13,w=0|s[5],R=8191&w,I=w>>>13,O=0|s[6],b=8191&O,P=O>>>13,D=0|s[7],S=8191&D,L=D>>>13,C=0|s[8],x=8191&C,U=C>>>13,G=0|s[9],k=8191&G,B=G>>>13,F=0|a[0],j=8191&F,V=F>>>13,Y=0|a[1],W=8191&Y,X=Y>>>13,K=0|a[2],z=8191&K,Z=K>>>13,H=0|a[3],q=8191&H,$=H>>>13,J=0|a[4],Q=8191&J,tt=J>>>13,et=0|a[5],rt=8191&et,it=et>>>13,nt=0|a[6],ot=8191&nt,st=nt>>>13,at=0|a[7],ut=8191&at,ht=at>>>13,lt=0|a[8],dt=8191<,ct=lt>>>13,ft=0|a[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var _t=(h+(i=Math.imul(d,j))|0)+((8191&(n=(n=Math.imul(d,V))+Math.imul(c,j)|0))<<13)|0;h=((o=Math.imul(c,V))+(n>>>13)|0)+(_t>>>26)|0,_t&=67108863,i=Math.imul(p,j),n=(n=Math.imul(p,V))+Math.imul(v,j)|0,o=Math.imul(v,V);var Et=(h+(i=i+Math.imul(d,W)|0)|0)+((8191&(n=(n=n+Math.imul(d,X)|0)+Math.imul(c,W)|0))<<13)|0;h=((o=o+Math.imul(c,X)|0)+(n>>>13)|0)+(Et>>>26)|0,Et&=67108863,i=Math.imul(E,j),n=(n=Math.imul(E,V))+Math.imul(m,j)|0,o=Math.imul(m,V),i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(v,W)|0,o=o+Math.imul(v,X)|0;var mt=(h+(i=i+Math.imul(d,z)|0)|0)+((8191&(n=(n=n+Math.imul(d,Z)|0)+Math.imul(c,z)|0))<<13)|0;h=((o=o+Math.imul(c,Z)|0)+(n>>>13)|0)+(mt>>>26)|0,mt&=67108863,i=Math.imul(y,j),n=(n=Math.imul(y,V))+Math.imul(g,j)|0,o=Math.imul(g,V),i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(p,z)|0,n=(n=n+Math.imul(p,Z)|0)+Math.imul(v,z)|0,o=o+Math.imul(v,Z)|0;var At=(h+(i=i+Math.imul(d,q)|0)|0)+((8191&(n=(n=n+Math.imul(d,$)|0)+Math.imul(c,q)|0))<<13)|0;h=((o=o+Math.imul(c,$)|0)+(n>>>13)|0)+(At>>>26)|0,At&=67108863,i=Math.imul(T,j),n=(n=Math.imul(T,V))+Math.imul(N,j)|0,o=Math.imul(N,V),i=i+Math.imul(y,W)|0,n=(n=n+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,i=i+Math.imul(E,z)|0,n=(n=n+Math.imul(E,Z)|0)+Math.imul(m,z)|0,o=o+Math.imul(m,Z)|0,i=i+Math.imul(p,q)|0,n=(n=n+Math.imul(p,$)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,$)|0;var yt=(h+(i=i+Math.imul(d,Q)|0)|0)+((8191&(n=(n=n+Math.imul(d,tt)|0)+Math.imul(c,Q)|0))<<13)|0;h=((o=o+Math.imul(c,tt)|0)+(n>>>13)|0)+(yt>>>26)|0,yt&=67108863,i=Math.imul(R,j),n=(n=Math.imul(R,V))+Math.imul(I,j)|0,o=Math.imul(I,V),i=i+Math.imul(T,W)|0,n=(n=n+Math.imul(T,X)|0)+Math.imul(N,W)|0,o=o+Math.imul(N,X)|0,i=i+Math.imul(y,z)|0,n=(n=n+Math.imul(y,Z)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,Z)|0,i=i+Math.imul(E,q)|0,n=(n=n+Math.imul(E,$)|0)+Math.imul(m,q)|0,o=o+Math.imul(m,$)|0,i=i+Math.imul(p,Q)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var gt=(h+(i=i+Math.imul(d,rt)|0)|0)+((8191&(n=(n=n+Math.imul(d,it)|0)+Math.imul(c,rt)|0))<<13)|0;h=((o=o+Math.imul(c,it)|0)+(n>>>13)|0)+(gt>>>26)|0,gt&=67108863,i=Math.imul(b,j),n=(n=Math.imul(b,V))+Math.imul(P,j)|0,o=Math.imul(P,V),i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,i=i+Math.imul(T,z)|0,n=(n=n+Math.imul(T,Z)|0)+Math.imul(N,z)|0,o=o+Math.imul(N,Z)|0,i=i+Math.imul(y,q)|0,n=(n=n+Math.imul(y,$)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,$)|0,i=i+Math.imul(E,Q)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(p,rt)|0,n=(n=n+Math.imul(p,it)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,it)|0;var Mt=(h+(i=i+Math.imul(d,ot)|0)|0)+((8191&(n=(n=n+Math.imul(d,st)|0)+Math.imul(c,ot)|0))<<13)|0;h=((o=o+Math.imul(c,st)|0)+(n>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,i=Math.imul(S,j),n=(n=Math.imul(S,V))+Math.imul(L,j)|0,o=Math.imul(L,V),i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(P,W)|0,o=o+Math.imul(P,X)|0,i=i+Math.imul(R,z)|0,n=(n=n+Math.imul(R,Z)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,Z)|0,i=i+Math.imul(T,q)|0,n=(n=n+Math.imul(T,$)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,$)|0,i=i+Math.imul(y,Q)|0,n=(n=n+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,i=i+Math.imul(E,rt)|0,n=(n=n+Math.imul(E,it)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,it)|0,i=i+Math.imul(p,ot)|0,n=(n=n+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var Tt=(h+(i=i+Math.imul(d,ut)|0)|0)+((8191&(n=(n=n+Math.imul(d,ht)|0)+Math.imul(c,ut)|0))<<13)|0;h=((o=o+Math.imul(c,ht)|0)+(n>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,i=Math.imul(x,j),n=(n=Math.imul(x,V))+Math.imul(U,j)|0,o=Math.imul(U,V),i=i+Math.imul(S,W)|0,n=(n=n+Math.imul(S,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,i=i+Math.imul(b,z)|0,n=(n=n+Math.imul(b,Z)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,Z)|0,i=i+Math.imul(R,q)|0,n=(n=n+Math.imul(R,$)|0)+Math.imul(I,q)|0,o=o+Math.imul(I,$)|0,i=i+Math.imul(T,Q)|0,n=(n=n+Math.imul(T,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,i=i+Math.imul(y,rt)|0,n=(n=n+Math.imul(y,it)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,it)|0,i=i+Math.imul(E,ot)|0,n=(n=n+Math.imul(E,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0,i=i+Math.imul(p,ut)|0,n=(n=n+Math.imul(p,ht)|0)+Math.imul(v,ut)|0,o=o+Math.imul(v,ht)|0;var Nt=(h+(i=i+Math.imul(d,dt)|0)|0)+((8191&(n=(n=n+Math.imul(d,ct)|0)+Math.imul(c,dt)|0))<<13)|0;h=((o=o+Math.imul(c,ct)|0)+(n>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,i=Math.imul(k,j),n=(n=Math.imul(k,V))+Math.imul(B,j)|0,o=Math.imul(B,V),i=i+Math.imul(x,W)|0,n=(n=n+Math.imul(x,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,i=i+Math.imul(S,z)|0,n=(n=n+Math.imul(S,Z)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,Z)|0,i=i+Math.imul(b,q)|0,n=(n=n+Math.imul(b,$)|0)+Math.imul(P,q)|0,o=o+Math.imul(P,$)|0,i=i+Math.imul(R,Q)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,i=i+Math.imul(T,rt)|0,n=(n=n+Math.imul(T,it)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,it)|0,i=i+Math.imul(y,ot)|0,n=(n=n+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,i=i+Math.imul(E,ut)|0,n=(n=n+Math.imul(E,ht)|0)+Math.imul(m,ut)|0,o=o+Math.imul(m,ht)|0,i=i+Math.imul(p,dt)|0,n=(n=n+Math.imul(p,ct)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,ct)|0;var wt=(h+(i=i+Math.imul(d,pt)|0)|0)+((8191&(n=(n=n+Math.imul(d,vt)|0)+Math.imul(c,pt)|0))<<13)|0;h=((o=o+Math.imul(c,vt)|0)+(n>>>13)|0)+(wt>>>26)|0,wt&=67108863,i=Math.imul(k,W),n=(n=Math.imul(k,X))+Math.imul(B,W)|0,o=Math.imul(B,X),i=i+Math.imul(x,z)|0,n=(n=n+Math.imul(x,Z)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,Z)|0,i=i+Math.imul(S,q)|0,n=(n=n+Math.imul(S,$)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,$)|0,i=i+Math.imul(b,Q)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,i=i+Math.imul(R,rt)|0,n=(n=n+Math.imul(R,it)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,it)|0,i=i+Math.imul(T,ot)|0,n=(n=n+Math.imul(T,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,i=i+Math.imul(y,ut)|0,n=(n=n+Math.imul(y,ht)|0)+Math.imul(g,ut)|0,o=o+Math.imul(g,ht)|0,i=i+Math.imul(E,dt)|0,n=(n=n+Math.imul(E,ct)|0)+Math.imul(m,dt)|0,o=o+Math.imul(m,ct)|0;var Rt=(h+(i=i+Math.imul(p,pt)|0)|0)+((8191&(n=(n=n+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(n>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,i=Math.imul(k,z),n=(n=Math.imul(k,Z))+Math.imul(B,z)|0,o=Math.imul(B,Z),i=i+Math.imul(x,q)|0,n=(n=n+Math.imul(x,$)|0)+Math.imul(U,q)|0,o=o+Math.imul(U,$)|0,i=i+Math.imul(S,Q)|0,n=(n=n+Math.imul(S,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,i=i+Math.imul(b,rt)|0,n=(n=n+Math.imul(b,it)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,it)|0,i=i+Math.imul(R,ot)|0,n=(n=n+Math.imul(R,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,i=i+Math.imul(T,ut)|0,n=(n=n+Math.imul(T,ht)|0)+Math.imul(N,ut)|0,o=o+Math.imul(N,ht)|0,i=i+Math.imul(y,dt)|0,n=(n=n+Math.imul(y,ct)|0)+Math.imul(g,dt)|0,o=o+Math.imul(g,ct)|0;var It=(h+(i=i+Math.imul(E,pt)|0)|0)+((8191&(n=(n=n+Math.imul(E,vt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,vt)|0)+(n>>>13)|0)+(It>>>26)|0,It&=67108863,i=Math.imul(k,q),n=(n=Math.imul(k,$))+Math.imul(B,q)|0,o=Math.imul(B,$),i=i+Math.imul(x,Q)|0,n=(n=n+Math.imul(x,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,i=i+Math.imul(S,rt)|0,n=(n=n+Math.imul(S,it)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,it)|0,i=i+Math.imul(b,ot)|0,n=(n=n+Math.imul(b,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,i=i+Math.imul(R,ut)|0,n=(n=n+Math.imul(R,ht)|0)+Math.imul(I,ut)|0,o=o+Math.imul(I,ht)|0,i=i+Math.imul(T,dt)|0,n=(n=n+Math.imul(T,ct)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,ct)|0;var Ot=(h+(i=i+Math.imul(y,pt)|0)|0)+((8191&(n=(n=n+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(n>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,i=Math.imul(k,Q),n=(n=Math.imul(k,tt))+Math.imul(B,Q)|0,o=Math.imul(B,tt),i=i+Math.imul(x,rt)|0,n=(n=n+Math.imul(x,it)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,it)|0,i=i+Math.imul(S,ot)|0,n=(n=n+Math.imul(S,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,i=i+Math.imul(b,ut)|0,n=(n=n+Math.imul(b,ht)|0)+Math.imul(P,ut)|0,o=o+Math.imul(P,ht)|0,i=i+Math.imul(R,dt)|0,n=(n=n+Math.imul(R,ct)|0)+Math.imul(I,dt)|0,o=o+Math.imul(I,ct)|0;var bt=(h+(i=i+Math.imul(T,pt)|0)|0)+((8191&(n=(n=n+Math.imul(T,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(n>>>13)|0)+(bt>>>26)|0,bt&=67108863,i=Math.imul(k,rt),n=(n=Math.imul(k,it))+Math.imul(B,rt)|0,o=Math.imul(B,it),i=i+Math.imul(x,ot)|0,n=(n=n+Math.imul(x,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,i=i+Math.imul(S,ut)|0,n=(n=n+Math.imul(S,ht)|0)+Math.imul(L,ut)|0,o=o+Math.imul(L,ht)|0,i=i+Math.imul(b,dt)|0,n=(n=n+Math.imul(b,ct)|0)+Math.imul(P,dt)|0,o=o+Math.imul(P,ct)|0;var Pt=(h+(i=i+Math.imul(R,pt)|0)|0)+((8191&(n=(n=n+Math.imul(R,vt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,vt)|0)+(n>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,i=Math.imul(k,ot),n=(n=Math.imul(k,st))+Math.imul(B,ot)|0,o=Math.imul(B,st),i=i+Math.imul(x,ut)|0,n=(n=n+Math.imul(x,ht)|0)+Math.imul(U,ut)|0,o=o+Math.imul(U,ht)|0,i=i+Math.imul(S,dt)|0,n=(n=n+Math.imul(S,ct)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,ct)|0;var Dt=(h+(i=i+Math.imul(b,pt)|0)|0)+((8191&(n=(n=n+Math.imul(b,vt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,vt)|0)+(n>>>13)|0)+(Dt>>>26)|0,Dt&=67108863,i=Math.imul(k,ut),n=(n=Math.imul(k,ht))+Math.imul(B,ut)|0,o=Math.imul(B,ht),i=i+Math.imul(x,dt)|0,n=(n=n+Math.imul(x,ct)|0)+Math.imul(U,dt)|0,o=o+Math.imul(U,ct)|0;var St=(h+(i=i+Math.imul(S,pt)|0)|0)+((8191&(n=(n=n+Math.imul(S,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(n>>>13)|0)+(St>>>26)|0,St&=67108863,i=Math.imul(k,dt),n=(n=Math.imul(k,ct))+Math.imul(B,dt)|0,o=Math.imul(B,ct);var Lt=(h+(i=i+Math.imul(x,pt)|0)|0)+((8191&(n=(n=n+Math.imul(x,vt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,vt)|0)+(n>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var Ct=(h+(i=Math.imul(k,pt))|0)+((8191&(n=(n=Math.imul(k,vt))+Math.imul(B,pt)|0))<<13)|0;return h=((o=Math.imul(B,vt))+(n>>>13)|0)+(Ct>>>26)|0,Ct&=67108863,u[0]=_t,u[1]=Et,u[2]=mt,u[3]=At,u[4]=yt,u[5]=gt,u[6]=Mt,u[7]=Tt,u[8]=Nt,u[9]=wt,u[10]=Rt,u[11]=It,u[12]=Ot,u[13]=bt,u[14]=Pt,u[15]=Dt,u[16]=St,u[17]=Lt,u[18]=Ct,0!==h&&(u[19]=h,r.length++),r};function v(t,e,r){return(new _).mulp(t,e,r)}function _(t,e){this.x=t,this.y=e}Math.imul||(p=f),o.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return r=10===this.length&&10===t.length?p(this,t,e):i<63?f(this,t,e):i<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r.strip()}(this,t,e):v(this,t,e),r},_.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,i=0;i>=1;return i},_.prototype.permute=function(t,e,r,i,n,o){for(var s=0;s>>=1)n++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*e;s>=26,e+=n/67108864|0,e+=o>>>26,this.words[r]=67108863&o}return 0!==e&&(this.words[r]=e,this.length++),this},o.prototype.muln=function(t){return this.clone().imuln(t)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(t){var e=function(t){for(var e=new Array(t.bitLength()),r=0;r>>n}return e}(t);if(0===e.length)return new o(1);for(var r=this,i=0;i=0);var e,r=t%26,n=(t-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(e=0;e>>26-r}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=n);h--){var d=0|this.words[h];this.words[h]=l<<26-o|d>>>o,l=d&a}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return i(0===this.negative),this.iushrn(t,e,r)},o.prototype.shln=function(t){return this.clone().ishln(t)},o.prototype.ushln=function(t){return this.clone().iushln(t)},o.prototype.shrn=function(t){return this.clone().ishrn(t)},o.prototype.ushrn=function(t){return this.clone().iushrn(t)},o.prototype.testn=function(t){i("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,n=1<=0);var e=t%26,r=(t-e)/26;if(i(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==e&&r++,this.length=Math.min(r,this.length),0!==e){var n=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},o.prototype.isubn=function(t){if(i("number"==typeof t),i(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(u/67108864|0),this.words[n+r]=67108863&o}for(;n>26,this.words[n+r]=67108863&o;if(0===a)return this.strip();for(i(-1===a),a=0,n=0;n>26,this.words[n]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),i=this.clone(),n=t,s=0|n.words[n.length-1];0!=(r=26-this._countBits(s))&&(n=n.ushln(r),i.iushln(r),s=0|n.words[n.length-1]);var a,u=i.length-n.length;if("mod"!==e){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var h=0;h=0;d--){var c=67108864*(0|i.words[n.length+d])+(0|i.words[n.length+d-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(n,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(n,1,d),i.isZero()||(i.negative^=1);a&&(a.words[d]=c)}return a&&a.strip(),i.strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:a||null,mod:i}},o.prototype.divmod=function(t,e,r){return i(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(a=this.neg().divmod(t,e),"mod"!==e&&(n=a.div.neg()),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:n,mod:s}):0===this.negative&&0!==t.negative?(a=this.divmod(t.neg(),e),"mod"!==e&&(n=a.div.neg()),{div:n,mod:a.mod}):0!=(this.negative&t.negative)?(a=this.neg().divmod(t.neg(),e),"div"!==e&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:a.div,mod:s}):t.length>this.length||this.cmp(t)<0?{div:new o(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new o(this.modn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new o(this.modn(t.words[0]))}:this._wordDiv(t,e);var n,s,a},o.prototype.div=function(t){return this.divmod(t,"div",!1).div},o.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},o.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},o.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){i(t<=67108863);for(var e=(1<<26)%t,r=0,n=this.length-1;n>=0;n--)r=(e*r+(0|this.words[n]))%t;return r},o.prototype.idivn=function(t){i(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var n=(0|this.words[r])+67108864*e;this.words[r]=n/t|0,e=n%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n=new o(1),s=new o(0),a=new o(0),u=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),d=e.clone();!e.isZero();){for(var c=0,f=1;0==(e.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(n.isOdd()||s.isOdd())&&(n.iadd(l),s.isub(d)),n.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(l),u.isub(d)),a.iushrn(1),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),n.isub(a),s.isub(u)):(r.isub(e),a.isub(n),u.isub(s))}return{a,b:u,gcd:r.iushln(h)}},o.prototype._invmp=function(t){i(0===t.negative),i(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var n,s=new o(1),a=new o(0),u=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,l=1;0==(e.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var d=0,c=1;0==(r.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(r.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(a)):(r.isub(e),a.isub(s))}return(n=0===e.cmpn(1)?s:a).cmpn(0)<0&&n.iadd(t),n},o.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},o.prototype.invm=function(t){return this.egcd(t).a.umod(t)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(t){return this.words[0]&t},o.prototype.bincn=function(t){i("number"==typeof t);var e=t%26,r=(t-e)/26,n=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(t){var e,r=t<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)e=1;else{r&&(t=-t),i(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},o.prototype.gtn=function(t){return 1===this.cmpn(t)},o.prototype.gt=function(t){return 1===this.cmp(t)},o.prototype.gten=function(t){return this.cmpn(t)>=0},o.prototype.gte=function(t){return this.cmp(t)>=0},o.prototype.ltn=function(t){return-1===this.cmpn(t)},o.prototype.lt=function(t){return-1===this.cmp(t)},o.prototype.lten=function(t){return this.cmpn(t)<=0},o.prototype.lte=function(t){return this.cmp(t)<=0},o.prototype.eqn=function(t){return 0===this.cmpn(t)},o.prototype.eq=function(t){return 0===this.cmp(t)},o.red=function(t){return new T(t)},o.prototype.toRed=function(t){return i(!this.red,"Already a number in reduction context"),i(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return i(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(t){return this.red=t,this},o.prototype.forceRed=function(t){return i(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return i(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return i(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return i(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return i(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return i(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return i(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},o.prototype.redSqr=function(){return i(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return i(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return i(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return i(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return i(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(t){return i(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var E={k256:null,p224:null,p192:null,p25519:null};function m(t,e){this.name=t,this.p=new o(e,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function A(){m.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function y(){m.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function g(){m.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){m.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else i(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function N(t){T.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}m.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},m.prototype.ireduce=function(t){var e,r=t;do{this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},m.prototype.split=function(t,e){t.iushrn(this.n,0,e)},m.prototype.imulK=function(t){return t.imul(this.k)},n(A,m),A.prototype.split=function(t,e){for(var r=4194303,i=Math.min(t.length,9),n=0;n>>22,o=s}o>>>=22,t.words[n-10]=o,0===o&&t.length>10?t.length-=10:t.length-=9},A.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(E[t])return E[t];var e;if("k256"===t)e=new A;else if("p224"===t)e=new y;else if("p192"===t)e=new g;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return E[t]=e,e},T.prototype._verify1=function(t){i(0===t.negative,"red works only with positives"),i(t.red,"red works only with red numbers")},T.prototype._verify2=function(t,e){i(0==(t.negative|e.negative),"red works only with positives"),i(t.red&&t.red===e.red,"red works only with red numbers")},T.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},T.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},T.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},T.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},T.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},T.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},T.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},T.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},T.prototype.isqr=function(t){return this.imul(t,t.clone())},T.prototype.sqr=function(t){return this.mul(t,t)},T.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(i(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var n=this.m.subn(1),s=0;!n.isZero()&&0===n.andln(1);)s++,n.iushrn(1);i(!n.isZero());var a=new o(1).toRed(this),u=a.redNeg(),h=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,h).cmp(u);)l.redIAdd(u);for(var d=this.pow(l,n),c=this.pow(t,n.addn(1).iushrn(1)),f=this.pow(t,n),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();i(_=0;i--){for(var h=e.words[i],l=u-1;l>=0;l--){var d=h>>l&1;n!==r[0]&&(n=this.sqr(n)),0!==d||0!==s?(s<<=1,s|=d,(4==++a||0===i&&0===l)&&(n=this.mul(n,r[s]),a=0,s=0)):a=0}u=26}return n},T.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},T.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new N(t)},n(N,T),N.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},N.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},N.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):n.cmpn(0)<0&&(o=n.iadd(this.m)),o._forceRed(this)},N.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),s=n;return n.cmp(this.m)>=0?s=n.isub(this.m):n.cmpn(0)<0&&(s=n.iadd(this.m)),s._forceRed(this)},N.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t=r.nmd(t),this)},6395:t=>{const e="0123456789abcdef".split(""),r=[1,256,65536,16777216],i=[0,8,16,24],n=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=t=>{var e,r,i,o,s,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,M,T,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)o=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=o^(h<<1|l>>>31),r=s^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(o<<1|s>>>31),r=c^(s<<1|o>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&M,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&T,t[5]=y^~M&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~T&v,t[7]=M^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=T^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=n[i],t[1]^=n[i+1]},s=t=>n=>{var s;if("0x"===n.slice(0,2)){s=[];for(var a=2,u=n.length;a{for(var s,a=n.length,u=t.blocks,h=t.blockCount<<2,l=t.blockCount,d=t.outputBlocks,c=t.s,f=0;f>2]|=n[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(t.start=_-h,t.block=u[l],_=0;_>2]|=r[3&_],t.lastByteIndex===h)for(u[0]=u[l],_=1;_>4&15]+e[15&p]+e[p>>12&15]+e[p>>8&15]+e[p>>20&15]+e[p>>16&15]+e[p>>28&15]+e[p>>24&15];E%l==0&&(o(c),_=0)}return"0x"+v})((t=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(e=[0,0,0,0,0,0,0,0,0,0],[].concat(e,e,e,e,e))};var e})(t),s)};t.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.version="4.0.47"},3850:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2069);e.AddressZero="0x0000000000000000000000000000000000000000",e.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",e.EtherSymbol="Ξ";var n=i.bigNumberify(-1);e.NegativeOne=n;var o=i.bigNumberify(0);e.Zero=o;var s=i.bigNumberify(1);e.One=s;var a=i.bigNumberify(2);e.Two=a;var u=i.bigNumberify("1000000000000000000");e.WeiPerEther=u;var h=i.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");e.MaxUint256=h},6666:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(1041);e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.MISSING_NEW="MISSING_NEW",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.NUMERIC_FAULT="NUMERIC_FAULT",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,o=!1;function s(t,r,n){if(o)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var s=[];Object.keys(n).forEach((function(t){try{s.push(t+"="+JSON.stringify(n[t]))}catch(e){s.push(t+"="+JSON.stringify(n[t].toString()))}})),s.push("version="+i.version);var a=t;s.length&&(t+=" ("+s.join(", ")+")");var u=new Error(t);throw u.reason=a,u.code=r,Object.keys(n).forEach((function(t){u[t]=n[t]})),u}e.throwError=s,e.checkNew=function(t,r){t instanceof r||s("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,i){i||(i=""),tr&&s("too many arguments"+i,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&s("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!t,n=!!r},e.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{"test".normalize(t)}catch(e){throw new Error("missing "+t)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){s("platform missing String.prototype.normalize",e.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:t.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function h(t,e){u>a[t]||console.log.apply(console,e)}function l(){for(var t=[],e=0;e{!function(){"use strict";var e="object"==typeof window?window:{};!e.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(e=r.g);for(var i=!e.JS_SHA3_NO_COMMON_JS&&t.exports,n="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(i){return new y(t,e,t).update(i)[r]()}},l=function(t,e,r){return function(i,n){return new y(t,e,n).update(i)[r]()}},d=function(t,e){var r=h(t,e,"hex");r.create=function(){return new y(t,e,t)},r.update=function(t){return r.create().update(t)};for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}y.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,i,n=t.length,s=this.blocks,a=this.byteCount,u=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=i<>2]|=(192|i>>6)<>2]|=(128|63&i)<=57344?(s[r>>2]|=(224|i>>12)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+n[15&t]+n[t>>12&15]+n[t>>8&15]+n[t>>20&15]+n[t>>16&15]+n[t>>28&15]+n[t>>24&15];a%e==0&&(g(r),s=0)}return o&&(t=r[s],o>0&&(u+=n[t>>4&15]+n[15&t]),o>1&&(u+=n[t>>12&15]+n[t>>8&15]),o>2&&(u+=n[t>>20&15]+n[t>>16&15])),u},y.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,a=this.outputBits>>3;t=n?new ArrayBuffer(i+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(t);s>8&255,u[t+2]=e>>16&255,u[t+3]=e>>24&255;a%r==0&&g(i)}return o&&(t=a<<2,e=i[s],o>0&&(u[t]=255&e),o>1&&(u[t+1]=e>>8&255),o>2&&(u[t+2]=e>>16&255)),u};var g=function(t){var e,r,i,n,o,a,u,h,l,d,c,f,p,v,_,E,m,A,y,g,M,T,N,w,R,I,O,b,P,D,S,L,C,x,U,G,k,B,F,j,V,Y,W,X,K,z,Z,H,q,$,J,Q,tt,et,rt,it,nt,ot,st,at,ut,ht,lt;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],a=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],l=t[5]^t[15]^t[25]^t[35]^t[45],d=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(a<<1|u>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(u<<1|a>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(h<<1|l>>>31),r=o^(l<<1|h>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=a^(d<<1|c>>>31),r=u^(c<<1|d>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=h^(f<<1|p>>>31),r=l^(p<<1|f>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=d^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,v=t[0],_=t[1],z=t[11]<<4|t[10]>>>28,Z=t[10]<<4|t[11]>>>28,b=t[20]<<3|t[21]>>>29,P=t[21]<<3|t[20]>>>29,at=t[31]<<9|t[30]>>>23,ut=t[30]<<9|t[31]>>>23,Y=t[40]<<18|t[41]>>>14,W=t[41]<<18|t[40]>>>14,x=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,E=t[13]<<12|t[12]>>>20,m=t[12]<<12|t[13]>>>20,H=t[22]<<10|t[23]>>>22,q=t[23]<<10|t[22]>>>22,D=t[33]<<13|t[32]>>>19,S=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,lt=t[43]<<2|t[42]>>>30,et=t[5]<<30|t[4]>>>2,rt=t[4]<<30|t[5]>>>2,G=t[14]<<6|t[15]>>>26,k=t[15]<<6|t[14]>>>26,A=t[25]<<11|t[24]>>>21,y=t[24]<<11|t[25]>>>21,$=t[34]<<15|t[35]>>>17,J=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,C=t[44]<<29|t[45]>>>3,w=t[6]<<28|t[7]>>>4,R=t[7]<<28|t[6]>>>4,it=t[17]<<23|t[16]>>>9,nt=t[16]<<23|t[17]>>>9,B=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,g=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,X=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,O=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,j=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,T=t[48]<<14|t[49]>>>18,N=t[49]<<14|t[48]>>>18,t[0]=v^~E&A,t[1]=_^~m&y,t[10]=w^~I&b,t[11]=R^~O&P,t[20]=x^~G&B,t[21]=U^~k&F,t[30]=X^~z&H,t[31]=K^~Z&q,t[40]=et^~it&ot,t[41]=rt^~nt&st,t[2]=E^~A&g,t[3]=m^~y&M,t[12]=I^~b&D,t[13]=O^~P&S,t[22]=G^~B&j,t[23]=k^~F&V,t[32]=z^~H&$,t[33]=Z^~q&J,t[42]=it^~ot&at,t[43]=nt^~st&ut,t[4]=A^~g&T,t[5]=y^~M&N,t[14]=b^~D&L,t[15]=P^~S&C,t[24]=B^~j&Y,t[25]=F^~V&W,t[34]=H^~$&Q,t[35]=q^~J&tt,t[44]=ot^~at&ht,t[45]=st^~ut<,t[6]=g^~T&v,t[7]=M^~N&_,t[16]=D^~L&w,t[17]=S^~C&R,t[26]=j^~Y&x,t[27]=V^~W&U,t[36]=$^~Q&X,t[37]=J^~tt&K,t[46]=at^~ht&et,t[47]=ut^~lt&rt,t[8]=T^~v&E,t[9]=N^~_&m,t[18]=L^~w&I,t[19]=C^~R&O,t[28]=Y^~x&G,t[29]=W^~U&k,t[38]=Q^~X&z,t[39]=tt^~K&Z,t[48]=ht^~et&it,t[49]=lt^~rt&nt,t[0]^=s[i],t[1]^=s[i+1]};if(i)t.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");e.gas=h.bigNumberify(r[1]),t=r[0]}var i=(r=t.split(" returns "))[0].match(_);if(!i)throw new Error("invalid signature");if(e.name=i[1].trim(),!e.name.match(E))throw new Error('invalid identifier: "'+i[1]+'"');if(k(i[2]).forEach((function(t){e.inputs.push(A(t))})),i[3].split(" ").forEach((function(t){switch(t){case"constant":e.constant=!0;break;case"payable":e.payable=!0,e.stateMutability="payable";break;case"pure":e.constant=!0,e.stateMutability="pure";break;case"view":e.constant=!0,e.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+t)}})),r.length>1){var n=r[1].match(_);if(""!=n[1].trim()||""!=n[3].trim())throw new Error("unexpected tokens");k(n[2]).forEach((function(t){e.outputs.push(A(t))}))}if("constructor"===e.name){if(e.type="constructor",e.outputs.length)throw new Error("constructor may not have outputs");delete e.name,delete e.outputs}return e}(t.trim()));throw new Error("unknown signature")};var g=function(t,e,r,i,n){this.coerceFunc=t,this.name=e,this.type=r,this.localName=i,this.dynamic=n},M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return c.defineReadOnly(r,"coder",e),r}return n(e,t),e.prototype.encode=function(t){return this.coder.encode(t)},e.prototype.decode=function(t,e){return this.coder.decode(t,e)},e}(g),T=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return n(e,t),e.prototype.encode=function(t){return l.arrayify([])},e.prototype.decode=function(t,e){if(e>t.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},e}(g),N=function(t){function e(e,r,i,n){var o=this,s=(i?"int":"uint")+8*r;return(o=t.call(this,e,s,s,n,!1)||this).size=r,o.signed=i,o}return n(e,t),e.prototype.encode=function(t){try{var e=h.bigNumberify(t);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(e.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),e.lt(r))throw new Error("out-of-bounds")}else if(e.lt(s.Zero)||e.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),l.padZeros(l.arrayify(e),32)}catch(e){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length=0?i:"")+"]",a=-1===i||r.dynamic;return(o=t.call(this,e,"array",s,n,a)||this).coder=r,o.length=i,o}return n(e,t),e.prototype.encode=function(t){Array.isArray(t)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=w.encode(e)),a.checkArgumentCount(e,t.length," in coder array"+(this.localName?" "+this.localName:""));for(var i=[],n=0;n256||n%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new N(t,n/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(n=parseInt(r[1]))||n>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:e}),new I(t,n,e.name);if(r=e.type.match(v)){var n=parseInt(r[2]||"-1");return(e=c.shallowCopy(e)).type=r[1],e=c.deepCopy(e),new U(t,F(t,e),n,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var i=[];return e.forEach((function(e){i.push(F(t,e))})),new G(t,i,r)}(t,e.components,e.name):""===e.type?new T(t,e.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var j=function(){function t(r){a.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):t,r.push(F(this.coerceFunc,e))}),this),l.hexlify(new G(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach((function(t){var e;e="string"==typeof t?A(t):c.deepCopy(t),r.push(F(this.coerceFunc,e))}),this),new G(this.coerceFunc,r,"_").decode(l.arrayify(e),0).value},t}();e.AbiCoder=j,e.defaultAbiCoder=new j},2990:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),i=0;i<40;i++)r[i]=e[i].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var n=0;n<40;n+=2)r[n>>1]>>4>=8&&(e[n]=e[n].toUpperCase()),(15&r[n>>1])>=8&&(e[n+1]=e[n+1].toUpperCase());return"0x"+e.join("")}for(var l={},d=0;d<10;d++)l[String(d)]=String(d);for(d=0;d<26;d++)l[String.fromCharCode(65+d)]=String(10+d);var c,f=Math.floor((c=9007199254740991,Math.log10?Math.log10(c):Math.log(c)/Math.LN10));function p(t){t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00";var e="";for(t.split("").forEach((function(t){e+=l[t]}));e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var i=String(98-parseInt(e,10)%97);i.length<2;)i="0"+i;return i}function v(t){var e=null;if("string"!=typeof t&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=h(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:t});else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==p(t)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:t}),e=new n.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new n.default.BN(v(t).substring(2),16).toString(36).toUpperCase();e.length<30;)e="0"+e;return"XE"+p("XE00"+e)+e},e.getContractAddress=function(t){if(!t.from)throw new Error("missing from address");var e=t.nonce;return v("0x"+s.keccak256(a.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))},e.getCreate2Address=function(t){var e=t.initCodeHash;t.initCode&&(e?s.keccak256(t.initCode)!==e&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:t}):e=s.keccak256(t.initCode)),e||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:t});var r=v(t.from),i=o.arrayify(t.salt);return 32!==i.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:t}),v("0x"+s.keccak256(o.concat(["0xff",r,i,e])).substring(26))}},2069:function(t,e,r){"use strict";var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},n=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var o=i(r(1303)),s=r(2453),a=r(589),u=n(r(6666)),h=new o.default.BN(-1);function l(t){var e=t.toString(16);return"-"===e[0]?e.length%2==0?"-0x0"+e.substring(1):"-0x"+e.substring(1):e.length%2==1?"0x0"+e:"0x"+e}function d(t){return f(v(t))}function c(t){return new p(l(t))}function f(t){var e=t._hex;return"-"===e[0]?new o.default.BN(e.substring(3),16).mul(h):new o.default.BN(e.substring(2),16)}var p=function(){function t(e){if(u.checkNew(this,t),a.setType(this,"BigNumber"),"string"==typeof e)s.isHexString(e)?("0x"==e&&(e="0x0"),a.defineReadOnly(this,"_hex",e)):"-"===e[0]&&s.isHexString(e.substring(1))?a.defineReadOnly(this,"_hex",e):e.match(/^-?[0-9]*$/)?(""==e&&(e="0"),a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:e});else if("number"==typeof e){parseInt(String(e))!==e&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:e,outputValue:parseInt(String(e))});try{a.defineReadOnly(this,"_hex",l(new o.default.BN(e)))}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else e instanceof t?a.defineReadOnly(this,"_hex",e._hex):e.toHexString?a.defineReadOnly(this,"_hex",l(d(e.toHexString()))):e._hex&&s.isHexString(e._hex)?a.defineReadOnly(this,"_hex",e._hex):s.isArrayish(e)?a.defineReadOnly(this,"_hex",l(new o.default.BN(s.hexlify(e).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:e})}return t.prototype.fromTwos=function(t){return c(f(this).fromTwos(t))},t.prototype.toTwos=function(t){return c(f(this).toTwos(t))},t.prototype.abs=function(){return"-"===this._hex[0]?c(f(this).mul(h)):this},t.prototype.add=function(t){return c(f(this).add(d(t)))},t.prototype.sub=function(t){return c(f(this).sub(d(t)))},t.prototype.div=function(t){return v(t).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),c(f(this).div(d(t)))},t.prototype.mul=function(t){return c(f(this).mul(d(t)))},t.prototype.mod=function(t){return c(f(this).mod(d(t)))},t.prototype.pow=function(t){return c(f(this).pow(d(t)))},t.prototype.maskn=function(t){return c(f(this).maskn(t))},t.prototype.eq=function(t){return f(this).eq(d(t))},t.prototype.lt=function(t){return f(this).lt(d(t))},t.prototype.lte=function(t){return f(this).lte(d(t))},t.prototype.gt=function(t){return f(this).gt(d(t))},t.prototype.gte=function(t){return f(this).gte(d(t))},t.prototype.isZero=function(){return f(this).isZero()},t.prototype.toNumber=function(){try{return f(this).toNumber()}catch(t){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},t.prototype.toString=function(){return f(this).toString(10)},t.prototype.toHexString=function(){return this._hex},t.isBigNumber=function(t){return a.isType(t,"BigNumber")},t}();function v(t){return p.isBigNumber(t)?t:new p(t)}e.BigNumber=p,e.bigNumberify=v},2453:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t){return!!t.toHexString}function s(t){return t.slice||(t.slice=function(){var e=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function a(t){if(!t||parseInt(String(t.length))!=t.length||"string"==typeof t)return!1;for(var e=0;e=256||parseInt(String(r))!=r)return!1}return!0}function u(t){if(null==t&&n.throwError("cannot convert null value to array",n.INVALID_ARGUMENT,{arg:"value",value:t}),o(t)&&(t=t.toHexString()),"string"==typeof t){var e=t.match(/^(0x)?[0-9a-fA-F]*$/);e||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==e[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),(t=t.substring(2)).length%2&&(t="0"+t);for(var r=[],i=0;i=9007199254740991&&n.throwError("out-of-range",n.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var e="";t;)e=d[15&t]+e,t=Math.floor(t/16);return e.length?(e.length%2&&(e="0"+e),"0x"+e):"0x00"}if("string"==typeof t){var r=t.match(/^(0x)?[0-9a-fA-F]*$/);return r||n.throwError("invalid hexidecimal string",n.INVALID_ARGUMENT,{arg:"value",value:t}),"0x"!==r[1]&&n.throwError("hex string must have 0x prefix",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2&&(t="0x0"+t.substring(2)),t}if(a(t)){for(var i=[],s=0;s>4]+d[15&u])}return"0x"+i.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function f(t,e){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length<2*e+2;)t="0x0"+t.substring(2);return t}function p(t){var e,r=0,i="0x",o="0x";if((e=t)&&null!=e.r&&null!=e.s){null==t.v&&null==t.recoveryParam&&n.throwError("at least on of recoveryParam or v must be specified",n.INVALID_ARGUMENT,{argument:"signature",value:t}),i=f(t.r,32),o=f(t.s,32),"string"==typeof(r=t.v)&&(r=parseInt(r,16));var s=t.recoveryParam;null==s&&null!=t.v&&(s=1-r%2),r=27+s}else{var a=u(t);if(65!==a.length)throw new Error("invalid signature");i=c(a.slice(0,32)),o=c(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:i,s:o,recoveryParam:r-27,v:r}}e.hexlify=c,e.hexDataLength=function(t){return l(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return l(t)||n.throwError("invalid hex data",n.INVALID_ARGUMENT,{arg:"value",value:t}),t.length%2!=0&&n.throwError("hex data length must be even",n.INVALID_ARGUMENT,{arg:"value",value:t}),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(l(t)||n.throwError("invalid hex string",n.INVALID_ARGUMENT,{arg:"value",value:t});t.length>3&&"0x0"===t.substring(0,3);)t="0x"+t.substring(3);return t},e.hexZeroPad=f,e.splitSignature=p,e.joinSignature=function(t){return c(h([(t=p(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},7839:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(4164),n=r(2453);e.keccak256=function(t){return"0x"+i.keccak_256(n.arrayify(t))}},589:function(t,e,r){"use strict";var i=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var r in t)Object.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e.default=t,e};Object.defineProperty(e,"__esModule",{value:!0});var n=i(r(6666));function o(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function s(t,e){return t&&t._ethersType===e}e.defineReadOnly=o,e.setType=function(t,e){Object.defineProperty(t,"_ethersType",{configurable:!1,value:e,writable:!1})},e.isType=s,e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach((function(i){var n=t[i];n instanceof Promise?r.push(n.then((function(t){return e[i]=t,null}))):e[i]=n})),Promise.all(r).then((function(){return e}))},e.checkProperties=function(t,e){t&&"object"==typeof t||n.throwError("invalid object",n.INVALID_ARGUMENT,{argument:"object",value:t}),Object.keys(t).forEach((function(r){e[r]||n.throwError("invalid object key - "+r,n.INVALID_ARGUMENT,{argument:"transaction",value:t,key:r})}))},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e};var a={boolean:!0,number:!0,string:!0};e.deepCopy=function t(e,r){if(null==e||a[typeof e])return e;if(Array.isArray(e)){var i=e.map((function(e){return t(e,r)}));return r&&Object.freeze(i),i}if("object"==typeof e){if(s(e,"BigNumber"))return e;if(s(e,"Description"))return e;if(s(e,"Indexed"))return e;for(var n in i={},e){var u=e[n];void 0!==u&&o(i,n,t(u,r))}return r&&Object.freeze(i),i}if("function"==typeof e)return e;throw new Error("Cannot deepCopy "+typeof e)},e.inheritable=function t(e){return function(r){var i,n;n=e,(i=r).super_=n,i.prototype=Object.create(n.prototype,{constructor:{value:i,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",t(r))}}},8854:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i=r(2453);function n(t){for(var e=[];t;)e.unshift(255&t),t>>=8;return e}function o(t,e,r){for(var i=0,n=0;ne+1+i)throw new Error("invalid rlp")}return{consumed:1+i,result:n}}function u(t,e){if(0===t.length)throw new Error("invalid rlp data");if(t[e]>=248){if(e+1+(r=t[e]-247)>t.length)throw new Error("too short");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("to short");return a(t,e,e+1+r,r+n)}if(t[e]>=192){if(e+1+(n=t[e]-192)>t.length)throw new Error("invalid rlp data");return a(t,e,e+1,n)}if(t[e]>=184){var r;if(e+1+(r=t[e]-183)>t.length)throw new Error("invalid rlp data");if(e+1+r+(n=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+n,result:i.hexlify(t.slice(e+1+r,e+1+r+n))}}if(t[e]>=128){var n;if(e+1+(n=t[e]-128)>t.length)throw new Error("invalid rlp data");return{consumed:1+n,result:i.hexlify(t.slice(e+1,e+1+n))}}return{consumed:1,result:i.hexlify(t[e])}}e.encode=function(t){return i.hexlify(s(t))},e.decode=function(t){var e=i.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},9469:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});var i,n=r(3850),o=r(6666),s=r(2453);function a(t,e){void 0===e&&(e=i.current),e!=i.current&&(o.checkNormalize(),t=t.normalize(e));for(var r=[],n=0;n>6|192),r.push(63&a|128);else if(55296==(64512&a)){n++;var u=t.charCodeAt(n);if(n>=t.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(t,e){t=s.arrayify(t);for(var r="",i=0;i>7!=0){var o=null,a=null;if(192==(224&n))o=1,a=127;else if(224==(240&n))o=2,a=2047;else{if(240!=(248&n)){if(!e){if(128==(192&n))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(i+o>t.length){if(!e)throw new Error("invalid utf8 byte sequence; too short");for(;i>6==2;i++);}else{for(var u=n&(1<<8-o-1)-1,h=0;h1114111){if(!e)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!e)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!e)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(n)}return r}!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(i=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=a,e.toUtf8String=u,e.formatBytes32String=function(t){var e=a(t);if(e.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([e,n.HashZero]).slice(0,32))},e.parseBytes32String=function(t){var e=s.arrayify(t);if(32!==e.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==e[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===e[r-1];)r--;return u(e.slice(0,r))}},7533:t=>{"use strict";var e,r="object"==typeof Reflect?Reflect:null,i=r&&"function"==typeof r.apply?r.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};e=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var n=Number.isNaN||function(t){return t!=t};function o(){o.init.call(this)}t.exports=o,t.exports.once=function(t,e){return new Promise((function(r,i){function n(r){t.removeListener(e,o),i(r)}function o(){"function"==typeof t.removeListener&&t.removeListener("error",n),r([].slice.call(arguments))}v(t,e,o,{once:!0}),"error"!==e&&function(t,e,r){"function"==typeof t.on&&v(t,"error",e,{once:!0})}(t,n)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function u(t){return void 0===t._maxListeners?o.defaultMaxListeners:t._maxListeners}function h(t,e,r,i){var n,o,s,h;if(a(r),void 0===(o=t._events)?(o=t._events=Object.create(null),t._eventsCount=0):(void 0!==o.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),void 0===s)s=o[e]=r,++t._eventsCount;else if("function"==typeof s?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),(n=u(t))>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,h=l,console&&console.warn&&console.warn(h)}return t}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=l.bind(i);return n.listener=r,i.wrapFn=n,n}function c(t,e,r){var i=t._events;if(void 0===i)return[];var n=i[e];return void 0===n?[]:"function"==typeof n?r?[n.listener||n]:[n]:r?function(t){for(var e=new Array(t.length),r=0;r0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var h=u.length,l=p(u,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,n=o;break}if(n<0)return this;0===n?r.shift():function(t,e){for(;e+1=0;i--)this.removeListener(t,e[i]);return this},o.prototype.listeners=function(t){return c(this,t,!0)},o.prototype.rawListeners=function(t){return c(this,t,!1)},o.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?e(this._events):[]}},9002:(t,e)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();t.exports=e=r.fetch,r.fetch&&(e.default=r.fetch.bind(r)),e.Headers=r.Headers,e.Request=r.Request,e.Response=r.Response},2143:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.parseError=void 0;const i=r(6112);e.parseError=function(t){return t instanceof i.ProviderError?t:Object.values(i.ProviderIssue).includes(t)?new i.ProviderError(t):new i.ProviderError(i.ProviderIssue.CONTRACT_ERROR,t)}},2072:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.buildGatewayConfig=void 0;const i=r(6898);e.buildGatewayConfig=function(t){switch(t){case i.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case i.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case i.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.Mutation=e.MutationStatus=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));class h extends s.EventEmitter{constructor(t,e,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=e,this._provider=t,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}complete(){return i(this,void 0,void 0,(function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((e,r)=>{this.isCompleted()?e(null):(this.once(o.MutationEvent.COMPLETE,(()=>e(null))),this.once(o.MutationEvent.ERROR,(t=>r(t)))),t&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return i(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const e=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=t.gasPrice,i=e.result*this._provider.retryGasPriceMultiplier,n=i>=r?i:r*this._provider.retryGasPriceMultiplier,o={from:t.from,data:t.input,nonce:t.nonce,value:t.value,gas:t.gas,gasPrice:`0x${Math.ceil(n).toString(16)}`};t.to&&(o.to=t.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t)throw new Error("Mutation not found");if(t.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(t.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const e=`0x${Math.ceil(1.1*t.gasPrice).toString(16)}`,r={from:t.from,to:t.from,nonce:t.nonce,value:"0x0",gasPrice:e},i=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=i.result}))}resolveCurrentState(){return i(this,void 0,void 0,(function*(){const t=yield this.getTransactionObject();if(!t||t.to&&"0x0"!==t.to||(t.to=yield this.getTransactionReceipt().then((t=>t?t.contractAddress:null))),t&&t.to){if(this._senderId=n.normalizeAddress(t.from),this._receiverId=n.normalizeAddress(t.to),this._confirmations=yield this.getLastBlock().then((e=>e-parseInt(t.blockNumber||e))).then((t=>t<0?0:t)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return i(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=t.find((t=>t.topic===e.topics[0]));if(!r)return void this._provider.log(JSON.stringify(e));const i={};i.event=r.name,i.address=e.address;const n=r.types.filter((t=>t.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((t=>t.kind===a.MutationEventTypeKind.INDEXED));if(n.length>0){const t=n.map((t=>t.type)),r=this._provider.encoder.decodeParameters(t,e.data);n.forEach(((t,e)=>{i[t.name]=r[e]}))}o.forEach(((t,r)=>{i[t.name]=this._provider.encoder.decodeParameters([t.type],e.topics[r+1])[0]})),this._logs.push(i)}))}catch(t){this._provider.log(t)}}))}}e.Mutation=h},1623:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.GenericProvider=void 0;const n=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class h extends s.EventEmitter{constructor(t){super(),this._id=0,this.encoder=void 0!==t.encoder?t.encoder:new n.Encoder,this.accountId=t.accountId,this.gatewayConfig=t.gatewayConfig,this.unsafeRecipientIds=t.unsafeRecipientIds,this.assetLedgerSource=t.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=t.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==t.signMethod?t.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==t.requiredConfirmations?t.requiredConfirmations:1,this.mutationTimeout=void 0!==t.mutationTimeout?t.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==t.gasPriceMultiplier?t.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==t.retryGasPriceMultiplier?t.retryGasPriceMultiplier:2,this.sandbox=void 0!==t.sandbox&&t.sandbox,this.verbose=void 0!==t.verbose&&t.verbose,this._client=t.client&&t.client.currentProvider?t.client.currentProvider:t.client}log(t){this.verbose&&console.log(t)}get accountId(){return this._accountId||null}set accountId(t){t=this.encoder.normalizeAddress(t),this.isCurrentAccount(t)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,t,this._accountId),this._accountId=t}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(t){this._unsafeRecipientIds=(t||[]).map((t=>this.encoder.normalizeAddress(t)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(t){this._gatewayConfig=void 0!==t?{actionsOrderId:this.encoder.normalizeAddress(t.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(t.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(t.valueLedgerDeployOrderId)}:null}emit(...t){return super.emit.call(this,...t),this}on(...t){return super.on.call(this,...t),this}once(...t){return super.once.call(this,...t),this}off(t,e){return e?super.off(t,e):super.removeAllListeners(t),this}sign(t){return i(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[t,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,t]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((t=>this.encoder.normalizeAddress(t)))}))}getNetworkVersion(){return i(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(t){return this.accountId===this.encoder.normalizeAddress(t)}isUnsafeRecipientId(t){const e=this.encoder.normalizeAddress(t);return!!this.unsafeRecipientIds.find((t=>t===e))}post(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length&&(this.sandbox||void 0===e.params[0].gas)){try{const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}catch(t){if(t&&t.original&&(-32603===t.original.code||-32e3===t.original.code)){e.params.push("latest");const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,t.result)}throw t}if(this.sandbox)return{id:null,jsonrpc:null,result:e.params[0].gas};if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign(Object.assign({},e),{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(t.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(e)}))}request(t){return i(this,void 0,void 0,(function*(){const e=Object.assign({jsonrpc:"2.0",id:t.id||this.getNextId(),params:[]},t);return new Promise(((t,r)=>{this._client.send(e,((i,n)=>i?(this.log(i),r(i)):n.error?(this.log(i),r(n.error)):n.id!==e.id?r("Invalid RPC id"):t(n)))})).catch((t=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,t)})).then((t=>{if("eth_call"===e.method&&t&&t.result&&-1!==t.result.indexOf("0x08c379a0")){const e=this.encoder.decodeParameters(["string"],`0x${t.result.substring(10)}`);throw a.parseError(e[0])}return t}))}))}getNextId(){return this._id++,this._id}}e.GenericProvider=h},6898:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.NetworkKind=e.MutationEventTypeKind=e.SignMethod=void 0,(n=e.SignMethod||(e.SignMethod={}))[n.ETH_SIGN=0]="ETH_SIGN",n[n.TREZOR=1]="TREZOR",n[n.NO_PREFIX=2]="NO_PREFIX",n[n.PERSONAL_SIGN=3]="PERSONAL_SIGN",(i=e.MutationEventTypeKind||(e.MutationEventTypeKind={}))[i.NORMAL=0]="NORMAL",i[i.INDEXED=1]="INDEXED",(r=e.NetworkKind||(e.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8330),e),n(r(677),e),n(r(2143),e),n(r(1868),e),n(r(1623),e),n(r(6898),e),n(r(2072),e)},2624:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(7203),e),n(r(881),e),n(r(1402),e),n(r(9030),e),n(r(3690),e),n(r(7170),e),n(r(3710),e),n(r(2057),e),n(r(9555),e),n(r(1389),e)},7203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.decodeParameters=e.encodeParameters=void 0;const i=new(r(861).AbiCoder);e.encodeParameters=function(t,e){return i.encode(t,e)},e.decodeParameters=function(t,e){return i.decode(t,e)}},1402:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.bigNumberify=e.BigNumber=void 0;const i=r(2069);var n=r(2069);Object.defineProperty(e,"BigNumber",{enumerable:!0,get:function(){return n.BigNumber}}),e.bigNumberify=function(t){return i.bigNumberify(t)}},9030:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Encoder=void 0;const i=r(861),n=r(2990);e.Encoder=class{constructor(){this.coder=new i.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?n.getAddress(t):null}}},3690:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.hexToBytes=void 0,e.hexToBytes=function(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.leftPad=void 0,e.leftPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+new Array(o).join(r||"0")+t}},881:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.normalizeAddress=void 0;const i=r(2990);e.normalizeAddress=function(t){return t?i.getAddress(t.toLowerCase()):null}},3710:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.rightPad=void 0,e.rightPad=function(t,e,r,i){const n=void 0===i?/^0x/i.test(t)||"number"==typeof t:i,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(o).join(r||"0")}},2057:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.stringToHex=void 0,e.stringToHex=function(t){let e="";for(let r=0;r{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ZERO_ADDRESS=void 0,e.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},8218:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedger=void 0;const n=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),h=r(6512),l=r(7061),d=r(3919),c=r(8926),f=r(2328);e.ValueLedger=class{constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}static deploy(t,e){return i(this,void 0,void 0,(function*(){return u.default(t,e)}))}static getInstance(t,e){return new this(t,e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),d.default(this,t,e)}))}getBalance(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t)}))}getInfo(){return i(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(t,e,r){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const i=yield d.default(this,e,r);return o.bigNumberify(i).gte(o.bigNumberify(t))}))}approveValue(t,e){return i(this,void 0,void 0,(function*(){e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!o.bigNumberify(t).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,e,t)}))}disapproveValue(t){return i(this,void 0,void 0,(function*(){return t=this._provider.encoder.normalizeAddress(t),a.default(this,t,"0")}))}transferValue(t){return i(this,void 0,void 0,(function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?l.default(this,e,r,t.value):h.default(this,r,t.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:n.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:n.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:n.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(8218),e)},646:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x095ea7b3"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},1225:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=r(5353),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:a,supply:u}){return i(this,void 0,void 0,(function*(){const i=(yield o.fetchJson(t.valueLedgerSource)).TokenMock.evm.bytecode.object,h={from:t.accountId,data:`0x${i}${t.encoder.encodeParameters(s,[e,r,a,u]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[h]});return new n.Mutation(t,l.result)}))}},7061:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","address","uint256"];e.default=function(t,e,r,s){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0x23b872dd"+t.provider.encoder.encodeParameters(o,[e,r,s]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,a.result,t)}))}},6512:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const n=r(3279),o=["address","uint256"];e.default=function(t,e,r){return i(this,void 0,void 0,(function*(){const i={from:t.provider.accountId,to:t.id,data:"0xa9059cbb"+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},s=yield t.provider.post({method:"eth_sendTransaction",params:[i]});return new n.Mutation(t.provider,s.result,t)}))}},3919:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address","address"],n=["uint256"];e.default=function(t,e,o){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0xdd62ed3e"+t.provider.encoder.encodeParameters(i,[e,o]).substr(2)},s=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,s.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},8926:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=["address"],n=["uint256"];e.default=function(t,e){return r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:"0x70a08231"+t.provider.encoder.encodeParameters(i,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(n,o.result)[0].toString()}catch(e){return t.provider.log(e),null}}))}},2328:function(t,e){"use strict";var r=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return r(this,void 0,void 0,(function*(){const e=yield Promise.all(i.map((e=>r(this,void 0,void 0,(function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,i.result)[0].toString()}catch(e){return t.provider.log(e),null}})))));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}}))}},4508:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},1340:(t,e)=>{"use strict";var r,i,n;Object.defineProperty(e,"__esModule",{value:!0}),e.AssetLedgerCapability=e.SuperAssetLedgerAbility=e.GeneralAssetLedgerAbility=void 0,(n=e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={}))[n.CREATE_ASSET=16]="CREATE_ASSET",n[n.REVOKE_ASSET=32]="REVOKE_ASSET",n[n.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",n[n.UPDATE_ASSET=128]="UPDATE_ASSET",n[n.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",n[n.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",n[n.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(i=e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={}))[i.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",i[i.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=e.AssetLedgerCapability||(e.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(t,e)=>{"use strict";var r,i;Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedgerDeployOrder=e.AssetLedgerDeployOrder=e.SignedFixedActionsOrder=e.FixedActionsOrder=e.SignedDynamicActionsOrder=e.DynamicActionsOrder=e.AssetSetOperatorOrder=e.DappValueApproveOrder=e.OrderKind=e.ActionsOrderActionKind=void 0,(i=e.ActionsOrderActionKind||(e.ActionsOrderActionKind={}))[i.CREATE_ASSET=1]="CREATE_ASSET",i[i.TRANSFER_ASSET=2]="TRANSFER_ASSET",i[i.TRANSFER_VALUE=3]="TRANSFER_VALUE",i[i.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",i[i.SET_ABILITIES=5]="SET_ABILITIES",i[i.DESTROY_ASSET=6]="DESTROY_ASSET",(r=e.OrderKind||(e.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",e.DappValueApproveOrder=class{},e.AssetSetOperatorOrder=class{},e.DynamicActionsOrder=class{},e.SignedDynamicActionsOrder=class{},e.FixedActionsOrder=class{},e.SignedFixedActionsOrder=class{},e.AssetLedgerDeployOrder=class{},e.ValueLedgerDeployOrder=class{}},2503:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderIssue=void 0,(r=e.ProviderIssue||(e.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0});const i=r(2503);e.default={[i.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[i.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[i.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[i.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[i.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[i.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[i.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[i.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[i.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[i.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[i.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[i.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[i.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[i.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[i.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[i.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[i.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[i.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[i.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[i.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[i.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[i.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[i.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[i.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[i.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[i.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[i.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[i.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[i.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[i.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[i.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[i.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[i.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[i.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[i.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[i.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(t,e)=>{"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.MutationEvent=void 0,(r=e.MutationEvent||(e.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ProviderError=e.ProviderEvent=void 0;const i=r(1414);var n;(n=e.ProviderEvent||(e.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",n.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=i.default[t]||`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}e.ProviderError=o},5079:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0})},6112:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(4508),e),n(r(677),e),n(r(1340),e),n(r(8330),e),n(r(8096),e),n(r(5079),e),n(r(2503),e)},5353:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(6496),e),n(r(509),e),n(r(9203),e),n(r(2890),e),n(r(4467),e),n(r(899),e),n(r(2938),e),n(r(7612),e)},6496:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.fetchJson=void 0,e.fetchJson=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(t,e).then((t=>t.json()));if(0===t.lastIndexOf("http",0))return r(9002)(t,e).then((t=>t.json()));try{return Object(function(){var t=new Error("Cannot find module 'fs'");throw t.code="MODULE_NOT_FOUND",t}()).promises.readFile(t,"utf8").then((t=>JSON.parse(t)))}catch(t){return null}}))}},9203:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.keccak256=void 0;const i=r(6395);e.keccak256=function(t){return i.keccak256(t)}},509:function(t,e,r){"use strict";var i=this&&this.__awaiter||function(t,e,r,i){return new(r||(r=Promise))((function(n,o){function s(t){try{u(i.next(t))}catch(t){o(t)}}function a(t){try{u(i.throw(t))}catch(t){o(t)}}function u(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,a)}u((i=i.apply(t,e||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=void 0,e.sha=function(t,e){return i(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),i=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(i)).map((t=>`00${t.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${t}`).update(e).digest("hex")}))}},2890:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=void 0,e.toFloat=function(t){return parseFloat(`${t}`)||0}},4467:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=void 0,e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},899:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=void 0,e.toSeconds=function(t){return parseInt(""+parseFloat(`${t}`)/1e3)||0}},2938:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0,e.toString=function(t){return null!=t?t.toString():null}},7612:(t,e)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=void 0,e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let i=0;return Object.keys(e).forEach((n=>{if(e[n]instanceof Object)r[i]=t(e[n]);else if(e[n]instanceof Array){let o=0;const s=[];e[n].forEach((r=>{s[o]=t(e[n]),o++})),r[i]=s}else r[i]=e[n];i++})),r}},1277:(t,e,r)=>{"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ValueLedger=void 0;const i=r(5508);class n extends i.ValueLedger{}e.ValueLedger=n},765:function(t,e,r){"use strict";var i=this&&this.__createBinding||(Object.create?function(t,e,r,i){void 0===i&&(i=r),Object.defineProperty(t,i,{enumerable:!0,get:function(){return e[r]}})}:function(t,e,r,i){void 0===i&&(i=r),t[i]=e[r]}),n=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||i(e,t,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(r(1277),e)},1111:t=>{"use strict";t.exports=void 0},2574:()=>{}},e={};function r(i){if(e[i])return e[i].exports;var n=e[i]={id:i,loaded:!1,exports:{}};return t[i].call(n.exports,n,n.exports,r),n.loaded=!0,n.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),r.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(765))})(); \ No newline at end of file diff --git a/dist/0xcert-wanchain.min.js b/dist/0xcert-wanchain.min.js index cd3e37818..3a5e0e556 100644 --- a/dist/0xcert-wanchain.min.js +++ b/dist/0xcert-wanchain.min.js @@ -1,2 +1,2 @@ /*! For license information please see 0xcert-wanchain.min.js.LICENSE.txt */ -(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],g=8191&y,A=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,b=0|s[5],w=8191&b,R=b>>>13,N=0|s[6],P=8191&N,M=N>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,j=0|s[9],G=8191&j,U=j>>>13,F=0|a[0],K=8191&F,B=F>>>13,V=0|a[1],Y=8191&V,z=V>>>13,X=0|a[2],H=8191&X,W=X>>>13,$=0|a[3],Z=8191&$,q=$>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,K))|0)+((8191&(i=(i=Math.imul(h,B))+Math.imul(l,K)|0))<<13)|0;d=((o=Math.imul(l,B))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,B))+Math.imul(v,K)|0,o=Math.imul(v,B);var me=(d+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,K),i=(i=Math.imul(m,B))+Math.imul(E,K)|0,o=Math.imul(E,B),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,z)|0;var Ee=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,B))+Math.imul(A,K)|0,o=Math.imul(A,B),n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,Z)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,B))+Math.imul(T,K)|0,o=Math.imul(T,B),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,q)|0;var ge=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,B))+Math.imul(R,K)|0,o=Math.imul(R,B),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var Ae=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,B))+Math.imul(M,K)|0,o=Math.imul(M,B),n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,B))+Math.imul(x,K)|0,o=Math.imul(x,B),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,z)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,B))+Math.imul(k,K)|0,o=Math.imul(k,B),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,B))+Math.imul(U,K)|0,o=Math.imul(U,B),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var be=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(G,Y),i=(i=Math.imul(G,z))+Math.imul(U,Y)|0,o=Math.imul(U,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,de)|0,n=n+Math.imul(m,he)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,W))+Math.imul(U,H)|0,o=Math.imul(U,W),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Re=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ve)|0)+Math.imul(E,pe)|0))<<13)|0;d=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(U,Z)|0,o=Math.imul(U,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var Ne=(d+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(A,pe)|0))<<13)|0;d=((o=o+Math.imul(A,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Pe=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(G,re),i=(i=Math.imul(G,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,le)|0;var Me=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(R,pe)|0))<<13)|0;d=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(G,oe),i=(i=Math.imul(G,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(M,pe)|0))<<13)|0;d=((o=o+Math.imul(M,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(G,ue),i=(i=Math.imul(G,de))+Math.imul(U,ue)|0,o=Math.imul(U,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(G,he),i=(i=Math.imul(G,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(G,pe))|0)+((8191&(i=(i=Math.imul(G,ve))+Math.imul(U,pe)|0))<<13)|0;return d=((o=Math.imul(U,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=me,u[2]=Ee,u[3]=ye,u[4]=ge,u[5]=Ae,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=be,u[10]=we,u[11]=Re,u[12]=Ne,u[13]=Pe,u[14]=Me,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?p(this,e,t):r<63?f(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t)},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(y,E),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return m[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,b,w,R,N,P,M,S,D,x,L,C,k,j,G,U,F,K,B,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,G=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=b^~R&P,e[11]=w^~N&M,e[20]=C^~j&U,e[21]=k^~G&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~P&S,e[13]=N^~M&D,e[22]=j^~U&K,e[23]=G^~F&B,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=P^~S&x,e[15]=M^~D&L,e[24]=U^~K&V,e[25]=F^~B&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&b,e[17]=D^~L&w,e[26]=K^~V&C,e[27]=B^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~b&R,e[19]=L^~w&N,e[28]=V^~C&j,e[29]=Y^~k&G,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];m%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new g(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new g(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new g(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}g.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(A(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&A(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,b,w,R,N,P,M,S,D,x,L,C,k,j,G,U,F,K,B,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,G=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=b^~R&P,e[11]=w^~N&M,e[20]=C^~j&U,e[21]=k^~G&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~P&S,e[13]=N^~M&D,e[22]=j^~U&K,e[23]=G^~F&B,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=P^~S&x,e[15]=M^~D&L,e[24]=U^~K&V,e[25]=F^~B&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&b,e[17]=D^~L&w,e[26]=K^~V&C,e[27]=B^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~b&R,e[19]=L^~w&N,e[28]=V^~C&j,e[29]=Y^~k&G,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(m))throw new Error('invalid identifier: "'+n[1]+'"');if(G(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");G(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var A=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(A),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(A),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=b.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new R(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new j(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var K=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new j(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new j(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=K,t.defaultAbiCoder=new K},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},5736:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Cert=void 0;const i=r(2461),o=r(5353),s=r(7077);class a{constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>n(this,void 0,void 0,(function*(){return o.sha(256,s.toString(e))})),noncer:e=>n(this,void 0,void 0,(function*(){return o.sha(256,e.join("."))}))},e))}static getInstance(e){return new a(e)}identify(e){return n(this,void 0,void 0,(function*(){return o.sha(256,JSON.stringify(!1!==e?this.sortSchema(this.schema):this.schema))}))}notarize(e){return n(this,void 0,void 0,(function*(){const t=this.buildSchemaProps(e),r=yield this.buildCompoundProps(t);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(r)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}expose(e,t){const r={};return t.forEach((t=>{const n=s.readPath(t,e);s.writePath(t,n,r)})),JSON.parse(JSON.stringify(r))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=this.buildSchemaProps(e),n=yield this.buildCompoundProps(r);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(n,t)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}calculate(e,t){return n(this,void 0,void 0,(function*(){try{return this.checkDataInclusion(e,t.data)?this.imprintRecipes(t.data):null}catch(e){return null}}))}imprint(e){return n(this,void 0,void 0,(function*(){return this.notarize(e).then((e=>e.data[0].nodes[0].hash)).catch((()=>null))}))}buildSchemaProps(e,t=this.schema,r=[]){if("array"===t.type){const n=(e||[]).map(((e,n)=>this.buildSchemaProps(e,t.items,[...r,n]))).reduce(((e,t)=>e.concat(t)),[]);return n.length>0?n:[this.buildSchemaProps(void 0,{},[...r])]}return"object"===t.type?Object.keys(t.properties).sort().map((n=>{const i=this.buildSchemaProps((e||{})[n],t.properties[n],[...r,n]);return-1===["object","array"].indexOf(t.properties[n].type)?[i]:i})).reduce(((e,t)=>e.concat(t)),[]):{path:r,value:e,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(e){return n(this,void 0,void 0,(function*(){e=[...e];const t=this.buildPropGroups(e),r=Object.keys(t).sort(((e,t)=>e>t?-1:1)).filter((e=>""!==e));for(const n of r){const r=t[n],i=[...e.filter((e=>e.group===n))].sort(((e,t)=>e.key>t.key?1:-1)).map((e=>e.value)),o=yield this.merkle.notarize(i,r);e.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return e.sort(((e,t)=>e.key>t.key?1:-1))}))}buildRecipes(e,t=null){return n(this,void 0,void 0,(function*(){const r=t?s.stepPaths(t).map((e=>e.join("."))):null,i={};return e.forEach((e=>i[e.group]=e.path.slice(0,-1))),Promise.all(Object.keys(i).map((t=>n(this,void 0,void 0,(function*(){const n=e.filter((e=>e.group===t)).map((e=>e.value));let o=yield this.merkle.notarize(n,i[t]);if(r){const n=e.filter((e=>e.group===t)).map(((e,t)=>-1===r.indexOf(e.key)?-1:t)).filter((e=>-1!==e));o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[t].join(".")))return{path:i[t],values:o.values,nodes:o.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))))).then((e=>e.filter((e=>!!e))))}))}checkDataInclusion(e,t){const r=this.buildSchemaProps(e);t=s.cloneObject(t).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e)));for(const n of r){const r=s.readPath(n.path,e);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=t.find((e=>e.key===i));if(!o)return!1;const a=this.getPathIndexes(n.path).pop(),u=o.values.find((e=>e.index===a));if(void 0!==u&&u.value!==r)return!1}return!0}imprintRecipes(e){return n(this,void 0,void 0,(function*(){if(0===e.length)return this.getEmptyImprint();e=s.cloneObject(e).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e))).sort(((e,t)=>e.path.length>t.path.length?-1:1));for(const t of e){const r=yield this.merkle.imprint(t).catch((()=>""));t.nodes.unshift({index:0,hash:r});const n=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),o=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find((e=>e.key===n));s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const t=e.find((e=>""===e.key));return t?t.nodes.find((e=>0===e.index)).hash:this.getEmptyImprint()}))}getPathIndexes(e){const t=[];let r=this.schema;for(const n of e)"array"===r.type?(t.push(n),r=r.items):"object"===r.type?(t.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):t.push(void 0);return t}getEmptyImprint(){return n(this,void 0,void 0,(function*(){return this.merkle.notarize([]).then((e=>e.nodes[0].hash))}))}buildPropGroups(e){const t={};return e.map((e=>{const t=[];return e.path.map((e=>(t.push(e),[...t])))})).reduce(((e,t)=>e.concat(t)),[]).forEach((e=>t[e.slice(0,-1).join(".")]=e.slice(0,-1))),t}sortSchema(e){return Object.keys(e).sort().reduce(((t,r)=>(Array.isArray(e[r])?t[r]=e[r].sort():"object"==typeof e[r]?t[r]=this.sortSchema(e[r]):t[r]=e[r],t)),{})}}t.Cert=a},3377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9230:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5736),t),i(r(3377),t)},7077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writePath=t.readPath=t.stepPaths=t.cloneObject=t.toString=void 0,t.toString=function(e){try{return null==e?"":`${e}`}catch(e){return""}},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.stepPaths=function(e){const t={"":[]};return e.forEach((e=>{const r=[];e.forEach((e=>{r.push(e),t[r.join(".")]=[...r]}))})),Object.keys(t).sort().map((e=>t[e]))},t.readPath=function e(t,r){try{return Array.isArray(t)?0===t.length?r:e(t.slice(1),r[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,r={}){let n=r=r||{};for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),m=r(8634),E=r(7045),y=r(5636),g=r(6075),A=r(8608),O=r(1785),I=r(7461),T=r(2746),b=r(3924),w=r(5434),R=r(6651),N=r(8453),P=r(9085),M=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),j=r(1399),G=r(9156),U=r(3022),F=r(9669),K=r(7734),B=r(4909),V=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?N.default(this,e):R.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):U.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),m.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),E.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=V.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case V.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=V.ProxyId.NFTOKEN_TRANSFER);break;case V.ProxyKind.CREATE_ASSET:t=V.ProxyId.XCERT_CREATE;break;case V.ProxyKind.DESTROY_ASSET:t=V.ProxyId.XCERT_BURN;break;case V.ProxyKind.MANAGE_ABILITIES:t=V.ProxyId.MANAGE_ABILITIES;break;case V.ProxyKind.TRANSFER_TOKEN:t=V.ProxyId.TOKEN_TRANSFER;break;case V.ProxyKind.UPDATE_ASSET:t=V.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return b.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),j.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8218:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),d=r(6512),c=r(7061),h=r(3919),l=r(8926),f=r(2328);t.ValueLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),h.default(this,e,t)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),l.default(this,e)}))}getInfo(){return n(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(e,t,r){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,t,r);return o.bigNumberify(n).gte(o.bigNumberify(e))}))}approveValue(e,t){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t);const r=yield this.getApprovedValue(this.provider.accountId,t);if(!o.bigNumberify(e).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,t,e)}))}disapproveValue(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),a.default(this,e,"0")}))}transferValue(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return e.senderId?c.default(this,t,r,e.value):d.default(this,r,e.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8218),t)},646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=["string","string","uint8","uint256"];t.default=function(e,{name:t,symbol:r,decimals:a,supply:u}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.valueLedgerSource)).TokenMock.evm.bytecode.object,d={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(s,[t,r,a,u]).substr(2)}`},c=yield e.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e,c.result)}))}},7061:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},6512:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa9059cbb"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3919:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xdd62ed3e"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},8926:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},2328:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],decimals:t[2],supply:t[3]}}))}},5836:function(e,t){"use strict";var r,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Merkle=t.MerkleHasherPosition=void 0,function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(r=t.MerkleHasherPosition||(t.MerkleHasherPosition={})),t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,r){return this._options.hasher(e,t,r)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return n(this,void 0,void 0,(function*(){const n=[...e],i=[],o=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(o,[...t,n.length],r.NODE)];for(let e=n.length-1;e>=0;e--){const o=s[0];i.unshift(yield this._options.noncer([...t,e]));const a=yield this._options.hasher(n[e],[...t,e],r.VALUE);s.unshift(yield this._options.hasher(`${a}${i[0]}`,[...t,e],r.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${o}`,[...t,e],r.NODE))}return{values:n.map(((e,t)=>({index:t,value:e,nonce:i[t]}))),nodes:s.map(((e,t)=>({index:t,hash:e})))}}))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=Math.max(...t.map((e=>e+1)),0),n=[],i=[e.nodes.find((e=>e.index===2*r))];for(let o=r-1;o>=0;o--)-1!==t.indexOf(o)?n.unshift(e.values.find((e=>e.index===o))):i.unshift(e.nodes.find((e=>e.index===2*o+1)));return{values:n,nodes:i}}))}imprint(e){return n(this,void 0,void 0,(function*(){const t=[...yield Promise.all(e.values.map(((e,t)=>n(this,void 0,void 0,(function*(){const n=yield this._options.hasher(e.value,[t],r.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],r.LEAF),value:e.value}}))))),...e.nodes];for(let e=Math.max(...t.map((e=>e.index+1)),0)-1;e>=0;e-=2){const n=t.find((t=>t.index===e)),i=t.find((t=>t.index===e-1));n&&i&&t.unshift({index:e-2,hash:yield this._options.hasher(`${i.hash}${n.hash}`,[e],r.NODE)})}const i=t.find((e=>0===e.index));return i?i.hash:null}))}}},2461:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5836),t)},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},2895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const n=r(5291);class i extends n.AssetLedger{}t.AssetLedger=i},7745:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(5291);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(2895),t)},2792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const n=r(8344);class i extends n.Gateway{}t.Gateway=i},2086:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyKind=t.AssetLedgerDeployOrder=t.FixedActionsOrder=t.SignedFixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.ActionsOrderActionKind=void 0;var o=r(8344);Object.defineProperty(t,"ActionsOrderActionKind",{enumerable:!0,get:function(){return o.ActionsOrderActionKind}}),Object.defineProperty(t,"DynamicActionsOrder",{enumerable:!0,get:function(){return o.DynamicActionsOrder}}),Object.defineProperty(t,"SignedDynamicActionsOrder",{enumerable:!0,get:function(){return o.SignedDynamicActionsOrder}}),Object.defineProperty(t,"SignedFixedActionsOrder",{enumerable:!0,get:function(){return o.SignedFixedActionsOrder}}),Object.defineProperty(t,"FixedActionsOrder",{enumerable:!0,get:function(){return o.FixedActionsOrder}}),Object.defineProperty(t,"AssetLedgerDeployOrder",{enumerable:!0,get:function(){return o.AssetLedgerDeployOrder}}),Object.defineProperty(t,"ProxyKind",{enumerable:!0,get:function(){return o.ProxyKind}}),i(r(2792),t)},1277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const n=r(5508);class i extends n.ValueLedger{}t.ValueLedger=i},765:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1277),t)},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9230),r(7745),r(2086),r(765))})(); \ No newline at end of file +(()=>{var e={1303:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(2574).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function u(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function d(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n=t;n-=2)i=u(e,t,n)<=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?""};var c=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],h=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],l=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function f(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,u=s/67108864|0;r.words[0]=a;for(var d=1;d>>26,h=67108863&u,l=Math.min(d,t.length-1),f=Math.max(0,d-e.length+1);f<=l;f++){var p=d-f|0;c+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[d]=0|h,u=0|c}return 0!==u?r.words[d]=0|u:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-u.length]+u+r:u+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var d=h[e],f=l[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var v=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?v+r:c[d-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,u="le"===t,d=new e(o),c=this.clone();if(u){for(a=0;!c.isZero();a++)s=c.andln(255),c.iushrn(8),d[a]=s;for(;a=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o>>26;for(;0!==i&&o>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;oe.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s>26,this.words[s]=67108863&t;for(;0!==o&&s>26,this.words[s]=67108863&t;if(0===o&&s>>13,f=0|s[1],p=8191&f,v=f>>>13,_=0|s[2],m=8191&_,E=_>>>13,y=0|s[3],g=8191&y,A=y>>>13,O=0|s[4],I=8191&O,T=O>>>13,b=0|s[5],w=8191&b,R=b>>>13,N=0|s[6],P=8191&N,M=N>>>13,S=0|s[7],D=8191&S,x=S>>>13,L=0|s[8],C=8191&L,k=L>>>13,j=0|s[9],G=8191&j,U=j>>>13,F=0|a[0],K=8191&F,B=F>>>13,V=0|a[1],Y=8191&V,z=V>>>13,X=0|a[2],H=8191&X,W=X>>>13,$=0|a[3],Z=8191&$,q=$>>>13,J=0|a[4],Q=8191&J,ee=J>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ue=8191&ae,de=ae>>>13,ce=0|a[8],he=8191&ce,le=ce>>>13,fe=0|a[9],pe=8191&fe,ve=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var _e=(d+(n=Math.imul(h,K))|0)+((8191&(i=(i=Math.imul(h,B))+Math.imul(l,K)|0))<<13)|0;d=((o=Math.imul(l,B))+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(p,K),i=(i=Math.imul(p,B))+Math.imul(v,K)|0,o=Math.imul(v,B);var me=(d+(n=n+Math.imul(h,Y)|0)|0)+((8191&(i=(i=i+Math.imul(h,z)|0)+Math.imul(l,Y)|0))<<13)|0;d=((o=o+Math.imul(l,z)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(m,K),i=(i=Math.imul(m,B))+Math.imul(E,K)|0,o=Math.imul(E,B),n=n+Math.imul(p,Y)|0,i=(i=i+Math.imul(p,z)|0)+Math.imul(v,Y)|0,o=o+Math.imul(v,z)|0;var Ee=(d+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(l,H)|0))<<13)|0;d=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(g,K),i=(i=Math.imul(g,B))+Math.imul(A,K)|0,o=Math.imul(A,B),n=n+Math.imul(m,Y)|0,i=(i=i+Math.imul(m,z)|0)+Math.imul(E,Y)|0,o=o+Math.imul(E,z)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,W)|0;var ye=(d+(n=n+Math.imul(h,Z)|0)|0)+((8191&(i=(i=i+Math.imul(h,q)|0)+Math.imul(l,Z)|0))<<13)|0;d=((o=o+Math.imul(l,q)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(I,K),i=(i=Math.imul(I,B))+Math.imul(T,K)|0,o=Math.imul(T,B),n=n+Math.imul(g,Y)|0,i=(i=i+Math.imul(g,z)|0)+Math.imul(A,Y)|0,o=o+Math.imul(A,z)|0,n=n+Math.imul(m,H)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,q)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,q)|0;var ge=(d+(n=n+Math.imul(h,Q)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(l,Q)|0))<<13)|0;d=((o=o+Math.imul(l,ee)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,K),i=(i=Math.imul(w,B))+Math.imul(R,K)|0,o=Math.imul(R,B),n=n+Math.imul(I,Y)|0,i=(i=i+Math.imul(I,z)|0)+Math.imul(T,Y)|0,o=o+Math.imul(T,z)|0,n=n+Math.imul(g,H)|0,i=(i=i+Math.imul(g,W)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,ee)|0;var Ae=(d+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(l,re)|0))<<13)|0;d=((o=o+Math.imul(l,ne)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(P,K),i=(i=Math.imul(P,B))+Math.imul(M,K)|0,o=Math.imul(M,B),n=n+Math.imul(w,Y)|0,i=(i=i+Math.imul(w,z)|0)+Math.imul(R,Y)|0,o=o+Math.imul(R,z)|0,n=n+Math.imul(I,H)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(g,Z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Oe=(d+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(l,oe)|0))<<13)|0;d=((o=o+Math.imul(l,se)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(D,K),i=(i=Math.imul(D,B))+Math.imul(x,K)|0,o=Math.imul(x,B),n=n+Math.imul(P,Y)|0,i=(i=i+Math.imul(P,z)|0)+Math.imul(M,Y)|0,o=o+Math.imul(M,z)|0,n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,ee)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,ee)|0,n=n+Math.imul(m,re)|0,i=(i=i+Math.imul(m,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,se)|0;var Ie=(d+(n=n+Math.imul(h,ue)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(l,ue)|0))<<13)|0;d=((o=o+Math.imul(l,de)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(C,K),i=(i=Math.imul(C,B))+Math.imul(k,K)|0,o=Math.imul(k,B),n=n+Math.imul(D,Y)|0,i=(i=i+Math.imul(D,z)|0)+Math.imul(x,Y)|0,o=o+Math.imul(x,z)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(M,H)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,q)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(g,re)|0,i=(i=i+Math.imul(g,ne)|0)+Math.imul(A,re)|0,o=o+Math.imul(A,ne)|0,n=n+Math.imul(m,oe)|0,i=(i=i+Math.imul(m,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,de)|0;var Te=(d+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,le)|0)+Math.imul(l,he)|0))<<13)|0;d=((o=o+Math.imul(l,le)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,B))+Math.imul(U,K)|0,o=Math.imul(U,B),n=n+Math.imul(C,Y)|0,i=(i=i+Math.imul(C,z)|0)+Math.imul(k,Y)|0,o=o+Math.imul(k,z)|0,n=n+Math.imul(D,H)|0,i=(i=i+Math.imul(D,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,q)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(I,re)|0,i=(i=i+Math.imul(I,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(g,oe)|0,i=(i=i+Math.imul(g,se)|0)+Math.imul(A,oe)|0,o=o+Math.imul(A,se)|0,n=n+Math.imul(m,ue)|0,i=(i=i+Math.imul(m,de)|0)+Math.imul(E,ue)|0,o=o+Math.imul(E,de)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,le)|0)+Math.imul(v,he)|0,o=o+Math.imul(v,le)|0;var be=(d+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,ve)|0)+Math.imul(l,pe)|0))<<13)|0;d=((o=o+Math.imul(l,ve)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(G,Y),i=(i=Math.imul(G,z))+Math.imul(U,Y)|0,o=Math.imul(U,z),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(k,H)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(D,Z)|0,i=(i=i+Math.imul(D,q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(R,re)|0,o=o+Math.imul(R,ne)|0,n=n+Math.imul(I,oe)|0,i=(i=i+Math.imul(I,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(g,ue)|0,i=(i=i+Math.imul(g,de)|0)+Math.imul(A,ue)|0,o=o+Math.imul(A,de)|0,n=n+Math.imul(m,he)|0,i=(i=i+Math.imul(m,le)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,le)|0;var we=(d+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;d=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,W))+Math.imul(U,H)|0,o=Math.imul(U,W),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(D,Q)|0,i=(i=i+Math.imul(D,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(P,re)|0,i=(i=i+Math.imul(P,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(R,oe)|0,o=o+Math.imul(R,se)|0,n=n+Math.imul(I,ue)|0,i=(i=i+Math.imul(I,de)|0)+Math.imul(T,ue)|0,o=o+Math.imul(T,de)|0,n=n+Math.imul(g,he)|0,i=(i=i+Math.imul(g,le)|0)+Math.imul(A,he)|0,o=o+Math.imul(A,le)|0;var Re=(d+(n=n+Math.imul(m,pe)|0)|0)+((8191&(i=(i=i+Math.imul(m,ve)|0)+Math.imul(E,pe)|0))<<13)|0;d=((o=o+Math.imul(E,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(U,Z)|0,o=Math.imul(U,q),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,ee)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(D,re)|0,i=(i=i+Math.imul(D,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(P,oe)|0,i=(i=i+Math.imul(P,se)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,se)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(R,ue)|0,o=o+Math.imul(R,de)|0,n=n+Math.imul(I,he)|0,i=(i=i+Math.imul(I,le)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,le)|0;var Ne=(d+(n=n+Math.imul(g,pe)|0)|0)+((8191&(i=(i=i+Math.imul(g,ve)|0)+Math.imul(A,pe)|0))<<13)|0;d=((o=o+Math.imul(A,ve)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(C,re)|0,i=(i=i+Math.imul(C,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(D,oe)|0,i=(i=i+Math.imul(D,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(P,ue)|0,i=(i=i+Math.imul(P,de)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,de)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(R,he)|0,o=o+Math.imul(R,le)|0;var Pe=(d+(n=n+Math.imul(I,pe)|0)|0)+((8191&(i=(i=i+Math.imul(I,ve)|0)+Math.imul(T,pe)|0))<<13)|0;d=((o=o+Math.imul(T,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(G,re),i=(i=Math.imul(G,ne))+Math.imul(U,re)|0,o=Math.imul(U,ne),n=n+Math.imul(C,oe)|0,i=(i=i+Math.imul(C,se)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,se)|0,n=n+Math.imul(D,ue)|0,i=(i=i+Math.imul(D,de)|0)+Math.imul(x,ue)|0,o=o+Math.imul(x,de)|0,n=n+Math.imul(P,he)|0,i=(i=i+Math.imul(P,le)|0)+Math.imul(M,he)|0,o=o+Math.imul(M,le)|0;var Me=(d+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(R,pe)|0))<<13)|0;d=((o=o+Math.imul(R,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(G,oe),i=(i=Math.imul(G,se))+Math.imul(U,oe)|0,o=Math.imul(U,se),n=n+Math.imul(C,ue)|0,i=(i=i+Math.imul(C,de)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,de)|0,n=n+Math.imul(D,he)|0,i=(i=i+Math.imul(D,le)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,le)|0;var Se=(d+(n=n+Math.imul(P,pe)|0)|0)+((8191&(i=(i=i+Math.imul(P,ve)|0)+Math.imul(M,pe)|0))<<13)|0;d=((o=o+Math.imul(M,ve)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(G,ue),i=(i=Math.imul(G,de))+Math.imul(U,ue)|0,o=Math.imul(U,de),n=n+Math.imul(C,he)|0,i=(i=i+Math.imul(C,le)|0)+Math.imul(k,he)|0,o=o+Math.imul(k,le)|0;var De=(d+(n=n+Math.imul(D,pe)|0)|0)+((8191&(i=(i=i+Math.imul(D,ve)|0)+Math.imul(x,pe)|0))<<13)|0;d=((o=o+Math.imul(x,ve)|0)+(i>>>13)|0)+(De>>>26)|0,De&=67108863,n=Math.imul(G,he),i=(i=Math.imul(G,le))+Math.imul(U,he)|0,o=Math.imul(U,le);var xe=(d+(n=n+Math.imul(C,pe)|0)|0)+((8191&(i=(i=i+Math.imul(C,ve)|0)+Math.imul(k,pe)|0))<<13)|0;d=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863;var Le=(d+(n=Math.imul(G,pe))|0)+((8191&(i=(i=Math.imul(G,ve))+Math.imul(U,pe)|0))<<13)|0;return d=((o=Math.imul(U,ve))+(i>>>13)|0)+(Le>>>26)|0,Le&=67108863,u[0]=_e,u[1]=me,u[2]=Ee,u[3]=ye,u[4]=ge,u[5]=Ae,u[6]=Oe,u[7]=Ie,u[8]=Te,u[9]=be,u[10]=we,u[11]=Re,u[12]=Ne,u[13]=Pe,u[14]=Me,u[15]=Se,u[16]=De,u[17]=xe,u[18]=Le,0!==d&&(u[19]=d,r.length++),r};function v(e,t,r){return(new _).mulp(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):v(this,e,t),r},_.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n>=1;return n},_.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s>>=1)i++;return 1<>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<s)for(this.length-=s,d=0;d=0&&(0!==c||d>=i);d--){var h=0|this.words[d];this.words[d]=c<<26-o|h>>>o,c=h&a}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!=(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,u=n.length-i.length;if("mod"!==t){(a=new o(null)).length=u+1,a.words=new Array(a.length);for(var d=0;d=0;h--){var l=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,h);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=l)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),u=new o(1),d=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++d;for(var c=r.clone(),h=t.clone();!t.isZero();){for(var l=0,f=1;0==(t.words[0]&f)&&l<26;++l,f<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,v=1;0==(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||u.isOdd())&&(a.iadd(c),u.isub(h)),a.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(u)):(r.isub(t),a.isub(i),u.isub(s))}return{a,b:u,gcd:r.iushln(d)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var d=0,c=1;0==(t.words[0]&c)&&d<26;++d,c<<=1);if(d>0)for(t.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);for(var h=0,l=1;0==(r.words[0]&l)&&h<26;++h,l<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new I(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var m={k256:null,p224:null,p192:null,p25519:null};function E(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){E.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function g(){E.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){E.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){E.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function I(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function T(e){I.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}E.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},E.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},E.prototype.split=function(e,t){e.iushrn(this.n,0,t)},E.prototype.imulK=function(e){return e.imul(this.k)},i(y,E),y.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},y.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(m[e])return m[e];var t;if("k256"===e)t=new y;else if("p224"===e)t=new g;else if("p192"===e)t=new A;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new O}return m[e]=t,t},I.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},I.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},I.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},I.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},I.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},I.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},I.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},I.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},I.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},I.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},I.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},I.prototype.isqr=function(e){return this.imul(e,e.clone())},I.prototype.sqr=function(e){return this.mul(e,e)},I.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),u=a.redNeg(),d=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,d).cmp(u);)c.redIAdd(u);for(var h=this.pow(c,i),l=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var v=f,_=0;0!==v.cmp(a);_++)v=v.redSqr();n(_=0;n--){for(var d=t.words[n],c=u-1;c>=0;c--){var h=d>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}u=26}return i},I.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},I.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new T(e)},i(T,I),T.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},T.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},T.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},T.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},T.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},6395:e=>{const t="0123456789abcdef".split(""),r=[1,256,65536,16777216],n=[0,8,16,24],i=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],o=e=>{var t,r,n,o,s,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,b,w,R,N,P,M,S,D,x,L,C,k,j,G,U,F,K,B,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)o=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=o^(d<<1|c>>>31),r=s^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(o<<1|s>>>31),r=l^(s<<1|o>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,G=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=b^~R&P,e[11]=w^~N&M,e[20]=C^~j&U,e[21]=k^~G&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~P&S,e[13]=N^~M&D,e[22]=j^~U&K,e[23]=G^~F&B,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=P^~S&x,e[15]=M^~D&L,e[24]=U^~K&V,e[25]=F^~B&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&b,e[17]=D^~L&w,e[26]=K^~V&C,e[27]=B^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~b&R,e[19]=L^~w&N,e[28]=V^~C&j,e[29]=Y^~k&G,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=i[n],e[1]^=i[n+1]},s=e=>i=>{var s;if("0x"===i.slice(0,2)){s=[];for(var a=2,u=i.length;a{for(var s,a=i.length,u=e.blocks,d=e.blockCount<<2,c=e.blockCount,h=e.outputBlocks,l=e.s,f=0;f>2]|=i[f]<>2]|=s<>2]|=(192|s>>6)<>2]|=(128|63&s)<=57344?(u[_>>2]|=(224|s>>12)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=d){for(e.start=_-d,e.block=u[c],_=0;_>2]|=r[3&_],e.lastByteIndex===d)for(u[0]=u[c],_=1;_>4&15]+t[15&p]+t[p>>12&15]+t[p>>8&15]+t[p>>20&15]+t[p>>16&15]+t[p>>28&15]+t[p>>24&15];m%c==0&&(o(l),_=0)}return"0x"+v})((e=>{return{blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(t=[0,0,0,0,0,0,0,0,0,0],[].concat(t,t,t,t,t))};var t})(e),s)};e.exports={keccak256:s(256),keccak512:s(512),keccak256s:s(256),keccak512s:s(512)}},1041:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.version="4.0.47"},3850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2069);t.AddressZero="0x0000000000000000000000000000000000000000",t.HashZero="0x0000000000000000000000000000000000000000000000000000000000000000",t.EtherSymbol="Ξ";var i=n.bigNumberify(-1);t.NegativeOne=i;var o=n.bigNumberify(0);t.Zero=o;var s=n.bigNumberify(1);t.One=s;var a=n.bigNumberify(2);t.Two=a;var u=n.bigNumberify("1000000000000000000");t.WeiPerEther=u;var d=n.bigNumberify("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");t.MaxUint256=d},6666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(1041);t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.MISSING_NEW="MISSING_NEW",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.NUMERIC_FAULT="NUMERIC_FAULT",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var i=!1,o=!1;function s(e,r,i){if(o)throw new Error("unknown error");r||(r=t.UNKNOWN_ERROR),i||(i={});var s=[];Object.keys(i).forEach((function(e){try{s.push(e+"="+JSON.stringify(i[e]))}catch(t){s.push(e+"="+JSON.stringify(i[e].toString()))}})),s.push("version="+n.version);var a=e;s.length&&(e+=" ("+s.join(", ")+")");var u=new Error(e);throw u.reason=a,u.code=r,Object.keys(i).forEach((function(e){u[e]=i[e]})),u}t.throwError=s,t.checkNew=function(e,r){e instanceof r||s("missing new",t.MISSING_NEW,{name:r.name})},t.checkArgumentCount=function(e,r,n){n||(n=""),er&&s("too many arguments"+n,t.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})},t.setCensorship=function(e,r){i&&s("error censorship permanent",t.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),o=!!e,i=!!r},t.checkNormalize=function(){try{if(["NFD","NFC","NFKD","NFKC"].forEach((function(e){try{"test".normalize(e)}catch(t){throw new Error("missing "+e)}})),String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){s("platform missing String.prototype.normalize",t.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:e.message})}};var a={debug:1,default:2,info:2,warn:3,error:4,off:5},u=a.default;function d(e,t){u>a[e]||console.log.apply(console,t)}function c(){for(var e=[],t=0;t{!function(){"use strict";var t="object"==typeof window?window:{};!t.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node&&(t=r.g);for(var n=!t.JS_SHA3_NO_COMMON_JS&&e.exports,i="0123456789abcdef".split(""),o=[0,8,16,24],s=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],u=["hex","buffer","arrayBuffer","array"],d=function(e,t,r){return function(n){return new g(e,t,e).update(n)[r]()}},c=function(e,t,r){return function(n,i){return new g(e,t,i).update(n)[r]()}},h=function(e,t){var r=d(e,t,"hex");r.create=function(){return new g(e,t,e)},r.update=function(e){return r.create().update(e)};for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}g.prototype.update=function(e){var t="string"!=typeof e;t&&e.constructor===ArrayBuffer&&(e=new Uint8Array(e));for(var r,n,i=e.length,s=this.blocks,a=this.byteCount,u=this.blockCount,d=0,c=this.s;d>2]|=e[d]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(s[r>>2]|=(224|n>>12)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<>2]|=(240|n>>18)<>2]|=(128|n>>12&63)<>2]|=(128|n>>6&63)<>2]|=(128|63&n)<=a){for(this.start=r-a,this.block=s[u],r=0;r>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t>4&15]+i[15&e]+i[e>>12&15]+i[e>>8&15]+i[e>>20&15]+i[e>>16&15]+i[e>>28&15]+i[e>>24&15];a%t==0&&(A(r),s=0)}return o&&(e=r[s],o>0&&(u+=i[e>>4&15]+i[15&e]),o>1&&(u+=i[e>>12&15]+i[e>>8&15]),o>2&&(u+=i[e>>20&15]+i[e>>16&15])),u},g.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,a=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(a);for(var u=new Uint32Array(e);s>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;a%r==0&&A(n)}return o&&(e=a<<2,t=n[s],o>0&&(u[e]=255&t),o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u};var A=function(e){var t,r,n,i,o,a,u,d,c,h,l,f,p,v,_,m,E,y,g,A,O,I,T,b,w,R,N,P,M,S,D,x,L,C,k,j,G,U,F,K,B,V,Y,z,X,H,W,$,Z,q,J,Q,ee,te,re,ne,ie,oe,se,ae,ue,de,ce;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],d=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(f=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|u>>>31),r=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(d<<1|c>>>31),r=o^(c<<1|d>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(h<<1|l>>>31),r=u^(l<<1|h>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=d^(f<<1|p>>>31),r=c^(p<<1|f>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=h^(i<<1|o>>>31),r=l^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],_=e[1],H=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,M=e[21]<<3|e[20]>>>29,ae=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,V=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,k=e[3]<<1|e[2]>>>31,m=e[13]<<12|e[12]>>>20,E=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,S=e[33]<<13|e[32]>>>19,D=e[32]<<13|e[33]>>>19,de=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,j=e[14]<<6|e[15]>>>26,G=e[15]<<6|e[14]>>>26,y=e[25]<<11|e[24]>>>21,g=e[24]<<11|e[25]>>>21,q=e[34]<<15|e[35]>>>17,J=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,L=e[44]<<29|e[45]>>>3,b=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,A=e[36]<<21|e[37]>>>11,O=e[37]<<21|e[36]>>>11,Q=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,z=e[8]<<27|e[9]>>>5,X=e[9]<<27|e[8]>>>5,R=e[18]<<20|e[19]>>>12,N=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,K=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,I=e[48]<<14|e[49]>>>18,T=e[49]<<14|e[48]>>>18,e[0]=v^~m&y,e[1]=_^~E&g,e[10]=b^~R&P,e[11]=w^~N&M,e[20]=C^~j&U,e[21]=k^~G&F,e[30]=z^~H&$,e[31]=X^~W&Z,e[40]=te^~ne&oe,e[41]=re^~ie&se,e[2]=m^~y&A,e[3]=E^~g&O,e[12]=R^~P&S,e[13]=N^~M&D,e[22]=j^~U&K,e[23]=G^~F&B,e[32]=H^~$&q,e[33]=W^~Z&J,e[42]=ne^~oe&ae,e[43]=ie^~se&ue,e[4]=y^~A&I,e[5]=g^~O&T,e[14]=P^~S&x,e[15]=M^~D&L,e[24]=U^~K&V,e[25]=F^~B&Y,e[34]=$^~q&Q,e[35]=Z^~J&ee,e[44]=oe^~ae&de,e[45]=se^~ue&ce,e[6]=A^~I&v,e[7]=O^~T&_,e[16]=S^~x&b,e[17]=D^~L&w,e[26]=K^~V&C,e[27]=B^~Y&k,e[36]=q^~Q&z,e[37]=J^~ee&X,e[46]=ae^~de&te,e[47]=ue^~ce&re,e[8]=I^~v&m,e[9]=T^~_&E,e[18]=x^~b&R,e[19]=L^~w&N,e[28]=V^~C&j,e[29]=Y^~k&G,e[38]=Q^~z&H,e[39]=ee^~X&W,e[48]=de^~te&ne,e[49]=ce^~re&ie,e[0]^=s[n],e[1]^=s[n+1]};if(n)e.exports=f;else for(v=0;v2)throw new Error("invalid signature");if(!r[1].match(/^[0-9]+$/))throw new Error("invalid signature gas");t.gas=d.bigNumberify(r[1]),e=r[0]}var n=(r=e.split(" returns "))[0].match(_);if(!n)throw new Error("invalid signature");if(t.name=n[1].trim(),!t.name.match(m))throw new Error('invalid identifier: "'+n[1]+'"');if(G(n[2]).forEach((function(e){t.inputs.push(y(e))})),n[3].split(" ").forEach((function(e){switch(e){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:a.info("unknown modifier: "+e)}})),r.length>1){var i=r[1].match(_);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");G(i[2]).forEach((function(e){t.outputs.push(y(e))}))}if("constructor"===t.name){if(t.type="constructor",t.outputs.length)throw new Error("constructor may not have outputs");delete t.name,delete t.outputs}return t}(e.trim()));throw new Error("unknown signature")};var A=function(e,t,r,n,i){this.coerceFunc=e,this.name=t,this.type=r,this.localName=n,this.dynamic=i},O=function(e){function t(t){var r=e.call(this,t.coerceFunc,t.name,t.type,void 0,t.dynamic)||this;return l.defineReadOnly(r,"coder",t),r}return i(t,e),t.prototype.encode=function(e){return this.coder.encode(e)},t.prototype.decode=function(e,t){return this.coder.decode(e,t)},t}(A),I=function(e){function t(t,r){return e.call(this,t,"null","",r,!1)||this}return i(t,e),t.prototype.encode=function(e){return c.arrayify([])},t.prototype.decode=function(e,t){if(t>e.length)throw new Error("invalid null");return{consumed:0,value:this.coerceFunc("null",void 0)}},t}(A),T=function(e){function t(t,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=e.call(this,t,s,s,i,!1)||this).size=r,o.signed=n,o}return i(t,e),t.prototype.encode=function(e){try{var t=d.bigNumberify(e);if(this.signed){var r=s.MaxUint256.maskn(8*this.size-1);if(t.gt(r))throw new Error("out-of-bounds");if(r=r.add(s.One).mul(s.NegativeOne),t.lt(r))throw new Error("out-of-bounds")}else if(t.lt(s.Zero)||t.gt(s.MaxUint256.maskn(8*this.size)))throw new Error("out-of-bounds");return t=t.toTwos(8*this.size).maskn(8*this.size),this.signed&&(t=t.fromTwos(8*this.size).toTwos(256)),c.padZeros(c.arrayify(t),32)}catch(t){a.throwError("invalid number value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e})}return null},t.prototype.decode=function(e,t){e.length=0?n:"")+"]",a=-1===n||r.dynamic;return(o=e.call(this,t,"array",s,i,a)||this).coder=r,o.length=n,o}return i(t,e),t.prototype.encode=function(e){Array.isArray(e)||a.throwError("expected array value",a.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:e});var t=this.length,r=new Uint8Array(0);-1===t&&(t=e.length,r=b.encode(t)),a.checkArgumentCount(t,e.length," in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&a.throwError("invalid "+r[1]+" bit length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new T(e,i/8,"int"===r[1],t.name);if(r=t.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&a.throwError("invalid bytes length",a.INVALID_ARGUMENT,{arg:"param",value:t}),new R(e,i,t.name);if(r=t.type.match(v)){var i=parseInt(r[2]||"-1");return(t=l.shallowCopy(t)).type=r[1],t=l.deepCopy(t),new k(e,F(e,t),i,t.name)}return"tuple"===t.type.substring(0,5)?function(e,t,r){t||(t=[]);var n=[];return t.forEach((function(t){n.push(F(e,t))})),new j(e,n,r)}(e,t.components,t.name):""===t.type?new I(e,t.name):(a.throwError("invalid type",a.INVALID_ARGUMENT,{arg:"type",value:t.type}),null)}var K=function(){function e(r){a.checkNew(this,e),r||(r=t.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return e.prototype.encode=function(e,t){e.length!==t.length&&a.throwError("types/values length mismatch",a.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):e,r.push(F(this.coerceFunc,t))}),this),c.hexlify(new j(this.coerceFunc,r,"_").encode(t))},e.prototype.decode=function(e,t){var r=[];return e.forEach((function(e){var t;t="string"==typeof e?y(e):l.deepCopy(e),r.push(F(this.coerceFunc,t))}),this),new j(this.coerceFunc,r,"_").decode(c.arrayify(t),0).value},e}();t.AbiCoder=K,t.defaultAbiCoder=new K},2990:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(1303)),o=r(2453),s=r(7839),a=r(8854),u=r(6666);function d(e){"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]{40}$/)||u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&r[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}for(var c={},h=0;h<10;h++)c[String(h)]=String(h);for(h=0;h<26;h++)c[String.fromCharCode(65+h)]=String(10+h);var l,f=Math.floor((l=9007199254740991,Math.log10?Math.log10(l):Math.log(l)/Math.LN10));function p(e){e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00";var t="";for(e.split("").forEach((function(e){t+=c[e]}));t.length>=f;){var r=t.substring(0,f);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function v(e){var t=null;if("string"!=typeof e&&u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e}),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=d(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&u.throwError("bad address checksum",u.INVALID_ARGUMENT,{arg:"address",value:e});else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==p(e)&&u.throwError("bad icap checksum",u.INVALID_ARGUMENT,{arg:"address",value:e}),t=new i.default.BN(e.substring(4),36).toString(16);t.length<40;)t="0"+t;t=d("0x"+t)}else u.throwError("invalid address",u.INVALID_ARGUMENT,{arg:"address",value:e});return t}t.getAddress=v,t.getIcapAddress=function(e){for(var t=new i.default.BN(v(e).substring(2),16).toString(36).toUpperCase();t.length<30;)t="0"+t;return"XE"+p("XE00"+t)+t},t.getContractAddress=function(e){if(!e.from)throw new Error("missing from address");var t=e.nonce;return v("0x"+s.keccak256(a.encode([v(e.from),o.stripZeros(o.hexlify(t))])).substring(26))},t.getCreate2Address=function(e){var t=e.initCodeHash;e.initCode&&(t?s.keccak256(e.initCode)!==t&&u.throwError("initCode/initCodeHash mismatch",u.INVALID_ARGUMENT,{arg:"options",value:e}):t=s.keccak256(e.initCode)),t||u.throwError("missing initCode or initCodeHash",u.INVALID_ARGUMENT,{arg:"options",value:e});var r=v(e.from),n=o.arrayify(e.salt);return 32!==n.length&&u.throwError("invalid salt",u.INVALID_ARGUMENT,{arg:"options",value:e}),v("0x"+s.keccak256(o.concat(["0xff",r,n,t])).substring(26))}},2069:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}},i=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var o=n(r(1303)),s=r(2453),a=r(589),u=i(r(6666)),d=new o.default.BN(-1);function c(e){var t=e.toString(16);return"-"===t[0]?t.length%2==0?"-0x0"+t.substring(1):"-0x"+t.substring(1):t.length%2==1?"0x0"+t:"0x"+t}function h(e){return f(v(e))}function l(e){return new p(c(e))}function f(e){var t=e._hex;return"-"===t[0]?new o.default.BN(t.substring(3),16).mul(d):new o.default.BN(t.substring(2),16)}var p=function(){function e(t){if(u.checkNew(this,e),a.setType(this,"BigNumber"),"string"==typeof t)s.isHexString(t)?("0x"==t&&(t="0x0"),a.defineReadOnly(this,"_hex",t)):"-"===t[0]&&s.isHexString(t.substring(1))?a.defineReadOnly(this,"_hex",t):t.match(/^-?[0-9]*$/)?(""==t&&(t="0"),a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))):u.throwError("invalid BigNumber string value",u.INVALID_ARGUMENT,{arg:"value",value:t});else if("number"==typeof t){parseInt(String(t))!==t&&u.throwError("underflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:t,outputValue:parseInt(String(t))});try{a.defineReadOnly(this,"_hex",c(new o.default.BN(t)))}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}}else t instanceof e?a.defineReadOnly(this,"_hex",t._hex):t.toHexString?a.defineReadOnly(this,"_hex",c(h(t.toHexString()))):t._hex&&s.isHexString(t._hex)?a.defineReadOnly(this,"_hex",t._hex):s.isArrayish(t)?a.defineReadOnly(this,"_hex",c(new o.default.BN(s.hexlify(t).substring(2),16))):u.throwError("invalid BigNumber value",u.INVALID_ARGUMENT,{arg:"value",value:t})}return e.prototype.fromTwos=function(e){return l(f(this).fromTwos(e))},e.prototype.toTwos=function(e){return l(f(this).toTwos(e))},e.prototype.abs=function(){return"-"===this._hex[0]?l(f(this).mul(d)):this},e.prototype.add=function(e){return l(f(this).add(h(e)))},e.prototype.sub=function(e){return l(f(this).sub(h(e)))},e.prototype.div=function(e){return v(e).isZero()&&u.throwError("division by zero",u.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),l(f(this).div(h(e)))},e.prototype.mul=function(e){return l(f(this).mul(h(e)))},e.prototype.mod=function(e){return l(f(this).mod(h(e)))},e.prototype.pow=function(e){return l(f(this).pow(h(e)))},e.prototype.maskn=function(e){return l(f(this).maskn(e))},e.prototype.eq=function(e){return f(this).eq(h(e))},e.prototype.lt=function(e){return f(this).lt(h(e))},e.prototype.lte=function(e){return f(this).lte(h(e))},e.prototype.gt=function(e){return f(this).gt(h(e))},e.prototype.gte=function(e){return f(this).gte(h(e))},e.prototype.isZero=function(){return f(this).isZero()},e.prototype.toNumber=function(){try{return f(this).toNumber()}catch(e){u.throwError("overflow",u.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:e.message})}return null},e.prototype.toString=function(){return f(this).toString(10)},e.prototype.toHexString=function(){return this._hex},e.isBigNumber=function(e){return a.isType(e,"BigNumber")},e}();function v(e){return p.isBigNumber(e)?e:new p(e)}t.BigNumber=p,t.bigNumberify=v},2453:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function a(e){if(!e||parseInt(String(e.length))!=e.length||"string"==typeof e)return!1;for(var t=0;t=256||parseInt(String(r))!=r)return!1}return!0}function u(e){if(null==e&&i.throwError("cannot convert null value to array",i.INVALID_ARGUMENT,{arg:"value",value:e}),o(e)&&(e=e.toHexString()),"string"==typeof e){var t=e.match(/^(0x)?[0-9a-fA-F]*$/);t||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==t[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),(e=e.substring(2)).length%2&&(e="0"+e);for(var r=[],n=0;n=9007199254740991&&i.throwError("out-of-range",i.NUMERIC_FAULT,{operartion:"hexlify",fault:"out-of-safe-range"});for(var t="";e;)t=h[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("string"==typeof e){var r=e.match(/^(0x)?[0-9a-fA-F]*$/);return r||i.throwError("invalid hexidecimal string",i.INVALID_ARGUMENT,{arg:"value",value:e}),"0x"!==r[1]&&i.throwError("hex string must have 0x prefix",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2&&(e="0x0"+e.substring(2)),e}if(a(e)){for(var n=[],s=0;s>4]+h[15&u])}return"0x"+n.join("")}return i.throwError("invalid hexlify value",null,{arg:"value",value:e}),"never"}function f(e,t){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length<2*t+2;)e="0x0"+e.substring(2);return e}function p(e){var t,r=0,n="0x",o="0x";if((t=e)&&null!=t.r&&null!=t.s){null==e.v&&null==e.recoveryParam&&i.throwError("at least on of recoveryParam or v must be specified",i.INVALID_ARGUMENT,{argument:"signature",value:e}),n=f(e.r,32),o=f(e.s,32),"string"==typeof(r=e.v)&&(r=parseInt(r,16));var s=e.recoveryParam;null==s&&null!=e.v&&(s=1-r%2),r=27+s}else{var a=u(e);if(65!==a.length)throw new Error("invalid signature");n=l(a.slice(0,32)),o=l(a.slice(32,64)),27!==(r=a[64])&&28!==r&&(r=27+r%2)}return{r:n,s:o,recoveryParam:r-27,v:r}}t.hexlify=l,t.hexDataLength=function(e){return c(e)&&e.length%2==0?(e.length-2)/2:null},t.hexDataSlice=function(e,t,r){return c(e)||i.throwError("invalid hex data",i.INVALID_ARGUMENT,{arg:"value",value:e}),e.length%2!=0&&i.throwError("hex data length must be even",i.INVALID_ARGUMENT,{arg:"value",value:e}),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)},t.hexStripZeros=function(e){for(c(e)||i.throwError("invalid hex string",i.INVALID_ARGUMENT,{arg:"value",value:e});e.length>3&&"0x0"===e.substring(0,3);)e="0x"+e.substring(3);return e},t.hexZeroPad=f,t.splitSignature=p,t.joinSignature=function(e){return l(d([(e=p(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}},7839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(4164),i=r(2453);t.keccak256=function(e){return"0x"+n.keccak_256(i.arrayify(e))}},589:function(e,t,r){"use strict";var n=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t};Object.defineProperty(t,"__esModule",{value:!0});var i=n(r(6666));function o(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){return e&&e._ethersType===t}t.defineReadOnly=o,t.setType=function(e,t){Object.defineProperty(e,"_ethersType",{configurable:!1,value:t,writable:!1})},t.isType=s,t.resolveProperties=function(e){var t={},r=[];return Object.keys(e).forEach((function(n){var i=e[n];i instanceof Promise?r.push(i.then((function(e){return t[n]=e,null}))):t[n]=i})),Promise.all(r).then((function(){return t}))},t.checkProperties=function(e,t){e&&"object"==typeof e||i.throwError("invalid object",i.INVALID_ARGUMENT,{argument:"object",value:e}),Object.keys(e).forEach((function(r){t[r]||i.throwError("invalid object key - "+r,i.INVALID_ARGUMENT,{argument:"transaction",value:e,key:r})}))},t.shallowCopy=function(e){var t={};for(var r in e)t[r]=e[r];return t};var a={boolean:!0,number:!0,string:!0};t.deepCopy=function e(t,r){if(null==t||a[typeof t])return t;if(Array.isArray(t)){var n=t.map((function(t){return e(t,r)}));return r&&Object.freeze(n),n}if("object"==typeof t){if(s(t,"BigNumber"))return t;if(s(t,"Description"))return t;if(s(t,"Indexed"))return t;for(var i in n={},t){var u=t[i];void 0!==u&&o(n,i,e(u,r))}return r&&Object.freeze(n),n}if("function"==typeof t)return t;throw new Error("Cannot deepCopy "+typeof t)},t.inheritable=function e(t){return function(r){var n,i;i=t,(n=r).super_=i,n.prototype=Object.create(i.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),o(r,"inherits",e(r))}}},8854:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2453);function i(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function o(e,t,r){for(var n=0,i=0;it+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}function u(e,t){if(0===e.length)throw new Error("invalid rlp data");if(e[t]>=248){if(t+1+(r=e[t]-247)>e.length)throw new Error("too short");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("to short");return a(e,t,t+1+r,r+i)}if(e[t]>=192){if(t+1+(i=e[t]-192)>e.length)throw new Error("invalid rlp data");return a(e,t,t+1,i)}if(e[t]>=184){var r;if(t+1+(r=e[t]-183)>e.length)throw new Error("invalid rlp data");if(t+1+r+(i=o(e,t+1,r))>e.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(e.slice(t+1+r,t+1+r+i))}}if(e[t]>=128){var i;if(t+1+(i=e[t]-128)>e.length)throw new Error("invalid rlp data");return{consumed:1+i,result:n.hexlify(e.slice(t+1,t+1+i))}}return{consumed:1,result:n.hexlify(e[t])}}t.encode=function(e){return n.hexlify(s(e))},t.decode=function(e){var t=n.arrayify(e),r=u(t,0);if(r.consumed!==t.length)throw new Error("invalid rlp data");return r.result}},9469:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n,i=r(3850),o=r(6666),s=r(2453);function a(e,t){void 0===t&&(t=n.current),t!=n.current&&(o.checkNormalize(),e=e.normalize(t));for(var r=[],i=0;i>6|192),r.push(63&a|128);else if(55296==(64512&a)){i++;var u=e.charCodeAt(i);if(i>=e.length||56320!=(64512&u))throw new Error("invalid utf-8 string");a=65536+((1023&a)<<10)+(1023&u),r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(a>>12|224),r.push(a>>6&63|128),r.push(63&a|128)}return s.arrayify(r)}function u(e,t){e=s.arrayify(e);for(var r="",n=0;n>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){if(!t){if(128==(192&i))throw new Error("invalid utf8 byte sequence; unexpected continuation byte");throw new Error("invalid utf8 byte sequence; invalid prefix")}continue}o=3,a=65535}if(n+o>e.length){if(!t)throw new Error("invalid utf8 byte sequence; too short");for(;n>6==2;n++);}else{for(var u=i&(1<<8-o-1)-1,d=0;d1114111){if(!t)throw new Error("invalid utf8 byte sequence; out-of-range")}else if(u>=55296&&u<=57343){if(!t)throw new Error("invalid utf8 byte sequence; utf-16 surrogate")}else u<=65535?r+=String.fromCharCode(u):(u-=65536,r+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u)));else if(!t)throw new Error("invalid utf8 byte sequence; invalid continuation byte")}}else r+=String.fromCharCode(i)}return r}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(n=t.UnicodeNormalizationForm||(t.UnicodeNormalizationForm={})),t.toUtf8Bytes=a,t.toUtf8String=u,t.formatBytes32String=function(e){var t=a(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return s.hexlify(s.concat([t,i.HashZero]).slice(0,32))},t.parseBytes32String=function(e){var t=s.arrayify(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return u(t.slice(0,r))}},7533:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function o(){o.init.call(this)}e.exports=o,e.exports.once=function(e,t){return new Promise((function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}v(e,t,o,{once:!0}),"error"!==t&&function(e,t,r){"function"==typeof e.on&&v(e,"error",t,{once:!0})}(e,i)}))},o.EventEmitter=o,o.prototype._events=void 0,o.prototype._eventsCount=0,o.prototype._maxListeners=void 0;var s=10;function a(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?o.defaultMaxListeners:e._maxListeners}function d(e,t,r,n){var i,o,s,d;if(a(r),void 0===(o=e._events)?(o=e._events=Object.create(null),e._eventsCount=0):(void 0!==o.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),o=e._events),s=o[t]),void 0===s)s=o[t]=r,++e._eventsCount;else if("function"==typeof s?s=o[t]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=u(e))>0&&s.length>i&&!s.warned){s.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=s.length,d=c,console&&console.warn&&console.warn(d)}return e}function c(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function h(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function l(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=new Array(e.length),r=0;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[e];if(void 0===u)return!1;if("function"==typeof u)n(u,this,t);else{var d=u.length,c=p(u,d);for(r=0;r=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},o.prototype.listeners=function(e){return l(this,e,!0)},o.prototype.rawListeners=function(e){return l(this,e,!1)},o.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},o.prototype.listenerCount=f,o.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},9002:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw new Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},5736:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Cert=void 0;const i=r(2461),o=r(5353),s=r(7077);class a{constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>n(this,void 0,void 0,(function*(){return o.sha(256,s.toString(e))})),noncer:e=>n(this,void 0,void 0,(function*(){return o.sha(256,e.join("."))}))},e))}static getInstance(e){return new a(e)}identify(e){return n(this,void 0,void 0,(function*(){return o.sha(256,JSON.stringify(!1!==e?this.sortSchema(this.schema):this.schema))}))}notarize(e){return n(this,void 0,void 0,(function*(){const t=this.buildSchemaProps(e),r=yield this.buildCompoundProps(t);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(r)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}expose(e,t){const r={};return t.forEach((t=>{const n=s.readPath(t,e);s.writePath(t,n,r)})),JSON.parse(JSON.stringify(r))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=this.buildSchemaProps(e),n=yield this.buildCompoundProps(r);return{$schema:"https://conventions.0xcert.org/87-asset-evidence.json",data:(yield this.buildRecipes(n,t)).map((e=>({path:e.path,nodes:e.nodes,values:e.values})))}}))}calculate(e,t){return n(this,void 0,void 0,(function*(){try{return this.checkDataInclusion(e,t.data)?this.imprintRecipes(t.data):null}catch(e){return null}}))}imprint(e){return n(this,void 0,void 0,(function*(){return this.notarize(e).then((e=>e.data[0].nodes[0].hash)).catch((()=>null))}))}buildSchemaProps(e,t=this.schema,r=[]){if("array"===t.type){const n=(e||[]).map(((e,n)=>this.buildSchemaProps(e,t.items,[...r,n]))).reduce(((e,t)=>e.concat(t)),[]);return n.length>0?n:[this.buildSchemaProps(void 0,{},[...r])]}return"object"===t.type?Object.keys(t.properties).sort().map((n=>{const i=this.buildSchemaProps((e||{})[n],t.properties[n],[...r,n]);return-1===["object","array"].indexOf(t.properties[n].type)?[i]:i})).reduce(((e,t)=>e.concat(t)),[]):{path:r,value:e,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(e){return n(this,void 0,void 0,(function*(){e=[...e];const t=this.buildPropGroups(e),r=Object.keys(t).sort(((e,t)=>e>t?-1:1)).filter((e=>""!==e));for(const n of r){const r=t[n],i=[...e.filter((e=>e.group===n))].sort(((e,t)=>e.key>t.key?1:-1)).map((e=>e.value)),o=yield this.merkle.notarize(i,r);e.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return e.sort(((e,t)=>e.key>t.key?1:-1))}))}buildRecipes(e,t=null){return n(this,void 0,void 0,(function*(){const r=t?s.stepPaths(t).map((e=>e.join("."))):null,i={};return e.forEach((e=>i[e.group]=e.path.slice(0,-1))),Promise.all(Object.keys(i).map((t=>n(this,void 0,void 0,(function*(){const n=e.filter((e=>e.group===t)).map((e=>e.value));let o=yield this.merkle.notarize(n,i[t]);if(r){const n=e.filter((e=>e.group===t)).map(((e,t)=>-1===r.indexOf(e.key)?-1:t)).filter((e=>-1!==e));o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[t].join(".")))return{path:i[t],values:o.values,nodes:o.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))))).then((e=>e.filter((e=>!!e))))}))}checkDataInclusion(e,t){const r=this.buildSchemaProps(e);t=s.cloneObject(t).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e)));for(const n of r){const r=s.readPath(n.path,e);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=t.find((e=>e.key===i));if(!o)return!1;const a=this.getPathIndexes(n.path).pop(),u=o.values.find((e=>e.index===a));if(void 0!==u&&u.value!==r)return!1}return!0}imprintRecipes(e){return n(this,void 0,void 0,(function*(){if(0===e.length)return this.getEmptyImprint();e=s.cloneObject(e).map((e=>Object.assign({key:e.path.join("."),group:e.path.slice(0,-1).join(".")},e))).sort(((e,t)=>e.path.length>t.path.length?-1:1));for(const t of e){const r=yield this.merkle.imprint(t).catch((()=>""));t.nodes.unshift({index:0,hash:r});const n=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),o=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find((e=>e.key===n));s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const t=e.find((e=>""===e.key));return t?t.nodes.find((e=>0===e.index)).hash:this.getEmptyImprint()}))}getPathIndexes(e){const t=[];let r=this.schema;for(const n of e)"array"===r.type?(t.push(n),r=r.items):"object"===r.type?(t.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):t.push(void 0);return t}getEmptyImprint(){return n(this,void 0,void 0,(function*(){return this.merkle.notarize([]).then((e=>e.nodes[0].hash))}))}buildPropGroups(e){const t={};return e.map((e=>{const t=[];return e.path.map((e=>(t.push(e),[...t])))})).reduce(((e,t)=>e.concat(t)),[]).forEach((e=>t[e.slice(0,-1).join(".")]=e.slice(0,-1))),t}sortSchema(e){return Object.keys(e).sort().reduce(((t,r)=>(Array.isArray(e[r])?t[r]=e[r].sort():"object"==typeof e[r]?t[r]=this.sortSchema(e[r]):t[r]=e[r],t)),{})}}t.Cert=a},3377:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},9230:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5736),t),i(r(3377),t)},7077:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.writePath=t.readPath=t.stepPaths=t.cloneObject=t.toString=void 0,t.toString=function(e){try{return null==e?"":`${e}`}catch(e){return""}},t.cloneObject=function(e){return JSON.parse(JSON.stringify(e))},t.stepPaths=function(e){const t={"":[]};return e.forEach((e=>{const r=[];e.forEach((e=>{r.push(e),t[r.join(".")]=[...r]}))})),Object.keys(t).sort().map((e=>t[e]))},t.readPath=function e(t,r){try{return Array.isArray(t)?0===t.length?r:e(t.slice(1),r[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,r={}){let n=r=r||{};for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getBitfieldFromAbilities=void 0;const n=r(2624);t.getBitfieldFromAbilities=function(e){let t=n.bigNumberify(0);return e.forEach((e=>{t=t.add(e)})),t.toHexString()}},365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getInterfaceCode=void 0;const n=r(6112);t.getInterfaceCode=function(e){return e==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":e==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":e==n.AssetLedgerCapability.UPDATE_ASSET?"0x0d04c3b8":e==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},877:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},212:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256","bytes32"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xb0e329e4"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3967:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=r(365),a=["string","string","string","string","bytes32","bytes4[]"];t.default=function(e,{name:t,symbol:r,uriPrefix:u,uriPostfix:d,schemaId:c,capabilities:h}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.assetLedgerSource)).XcertMock.evm.bytecode.object,l=(h||[]).map((e=>s.getInterfaceCode(e))),f={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(a,[t,r,u,d,`0x${c}`,l]).substr(2)}`},p=yield e.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(e,p.result)}))}},8260:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x9d118770"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},8943:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0ab319e8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},4494:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xf394b6df"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0x20c5429b"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},1463:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279);t.default=function(e,t,r,o,s){return n(this,void 0,void 0,(function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==s&&a.push("bytes");const u=[t,r,o,s].filter((e=>void 0!==e)),d={from:e.provider.accountId,to:e.id,data:n+e.provider.encoder.encodeParameters(a,u).substr(2)},c=yield e.provider.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e.provider,c.result,e)}))}},7234:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x15ec3b8b"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3016:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa22cb465"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5641:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r={from:e.provider.accountId,to:e.id,data:"0xbedb86fb"+e.provider.encoder.encodeParameters(o,[!t]).substr(2)},n=yield e.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(e.provider,n.result,e)}))}},4583:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},2513:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["uint256","bytes32"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x0d04c3b8"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},5421:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["string","string"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x89b73ec0"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1999:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=["address","uint256"],s=["bool"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){return Promise.all([i.SuperAssetLedgerAbility.MANAGE_ABILITIES,i.GeneralAssetLedgerAbility.CREATE_ASSET,i.GeneralAssetLedgerAbility.REVOKE_ASSET,i.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,i.GeneralAssetLedgerAbility.UPDATE_ASSET,i.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,i.GeneralAssetLedgerAbility.UPDATE_URI_BASE,i.GeneralAssetLedgerAbility.ALLOW_UPDATE_ASSET_IMPRINT].map((r=>n(this,void 0,void 0,(function*(){const n={to:e.id,data:"0xba00a330"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]?r:-1}))))).then((e=>e.filter((e=>-1!==e)).sort(((e,t)=>e-t)))).catch((t=>(e.provider.log(t),[])))}))}},1741:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","uint256"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x2f745c59"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},3206:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(9512),o=["uint256"],s=["address"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x081812fc"+e.provider.encoder.encodeParameters(o,[t]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(r){return e.provider.log(r),i.default(e,t)}}))}},195:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x6352211e"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8548:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x4f6ccce7"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},8661:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x49846680",inputTypes:["uint256"],outputTypes:["bytes","string"]},{signature:"0xcaae188e",inputTypes:["uint256"],outputTypes:["bytes","string"]}];t.default=function(e,t){return r(this,void 0,void 0,(function*(){const i=yield Promise.all(n.map((n=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:n.signature+e.provider.encoder.encodeParameters(n.inputTypes,[t]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(n.outputTypes,i.result)[0]}catch(t){return e.provider.log(t),null}})))));return{id:t,uri:i[0],imprint:i[1]?i[1].substr(2):null,schemaId:i[2]?i[2].substr(2):null}}))}},4977:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},5289:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(6112),o=r(365),s=["bytes4"],a=["bool"];t.default=function(e){return n(this,void 0,void 0,(function*(){return Promise.all([i.AssetLedgerCapability.DESTROY_ASSET,i.AssetLedgerCapability.REVOKE_ASSET,i.AssetLedgerCapability.TOGGLE_TRANSFERS,i.AssetLedgerCapability.UPDATE_ASSET].map((t=>n(this,void 0,void 0,(function*(){const r=o.getInterfaceCode(t),n={to:e.id,data:"0x01ffc9a7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(a,i.result)[0]?t:-1}))))).then((e=>e.filter((e=>-1!==e)).sort())).catch((t=>(e.provider.log(t),[])))}))}},1066:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x62b99ad4",inputTypes:[],outputTypes:["string"]},{signature:"0xc298bba5",inputTypes:[],outputTypes:["string"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],uriPrefix:t[2],uriPostfix:t[3],supply:t[4]}}))}},4373:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["bool"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xe985e9c5"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0]}catch(t){return e.provider.log(t),null}}))}},7877:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[],i=["bool"];t.default=function(e){return r(this,void 0,void 0,(function*(){try{const t={to:e.id,data:"0xb187bd26"+e.provider.encoder.encodeParameters(n,[]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return!e.provider.encoder.decodeParameters(i,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},9512:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint256"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x481af3d3"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},4794:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(250),u=r(791),d=r(48),c=r(3365),h=r(7139),l=r(8768),f=r(3665),p=r(9610),v=r(5391),_=r(7172),m=r(8634),E=r(7045),y=r(5636),g=r(6075),A=r(8608),O=r(1785),I=r(7461),T=r(2746),b=r(3924),w=r(5434),R=r(6651),N=r(8453),P=r(9085),M=r(9626),S=r(1006),D=r(2255),x=r(8082),L=r(4997),C=r(6389),k=r(7008),j=r(1399),G=r(9156),U=r(3022),F=r(9669),K=r(7734),B=r(4909),V=r(3105);t.Gateway=class{constructor(e,t){this._provider=e,this.config=t||e.gatewayConfig}static getInstance(e,t){return new this(e,t)}get config(){return this._config||null}set config(e){this._config=e?{actionsOrderId:this._provider.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this._provider.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}get provider(){return this._provider}hash(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),a.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),u.createOrderHash(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),h.createOrderHash(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),d.createOrderHash(e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),c.createOrderHash(e);throw new Error("Not implemented")}))}sign(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?I.default(this,e):O.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?N.default(this,e):R.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?F.default(this,e):U.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?D.default(this,e):S.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?k.default(this,e):C.default(this,e);throw new Error("Not implemented")}))}perform(e,t){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length+1)throw new s.ProviderError(s.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER){if((e=this.createDynamicOrder(e)).signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER){if(e.signers.length!==t.length)throw new s.ProviderError(s.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES);return e=a.normalizeOrderIds(e,this._provider),f.default(this,e,t)}if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),v.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),A.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),m.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),y.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}cancel(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),l.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),p.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),g.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),_.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),E.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getProxyAccountId(...e){return n(this,void 0,void 0,(function*(){let t=V.ProxyId.NFTOKEN_SAFE_TRANSFER;switch(e[0]){case V.ProxyKind.TRANSFER_ASSET:void 0!==e[1]&&-1!==this.provider.unsafeRecipientIds.indexOf(e[1])&&(t=V.ProxyId.NFTOKEN_TRANSFER);break;case V.ProxyKind.CREATE_ASSET:t=V.ProxyId.XCERT_CREATE;break;case V.ProxyKind.DESTROY_ASSET:t=V.ProxyId.XCERT_BURN;break;case V.ProxyKind.MANAGE_ABILITIES:t=V.ProxyId.MANAGE_ABILITIES;break;case V.ProxyKind.TRANSFER_TOKEN:t=V.ProxyId.TOKEN_TRANSFER;break;case V.ProxyKind.UPDATE_ASSET:t=V.ProxyId.XCERT_UPDATE;break;default:throw new s.ProviderError(s.ProviderIssue.PROXY_KIND_NOT_SUPPORTED)}return b.default(this,t)}))}isValidSignature(e,t,r){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER&&"undefined"!==r)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER&&"undefined"!==r)return e=a.normalizeOrderIds(e,this._provider),w.default(this,e,t,r);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),M.default(this,e,t);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),B.default(this,e,t);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),L.default(this,e,t);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),G.default(this,e,t);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getOrderDataClaim(e){return n(this,void 0,void 0,(function*(){if(e.kind===s.OrderKind.DYNAMIC_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_DYNAMIC_ACTIONS_ORDER)return e=this.createDynamicOrder(e),e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.FIXED_ACTIONS_ORDER||e.kind===s.OrderKind.SIGNED_FIXED_ACTIONS_ORDER)return e=a.normalizeOrderIds(e,this._provider),T.default(this,e);if(e.kind===s.OrderKind.ASSET_LEDGER_DEPLOY_ORDER)return e=u.normalizeOrderIds(e,this._provider),P.default(this,e);if(e.kind===s.OrderKind.VALUE_LEDGER_DEPLOY_ORDER)return e=h.normalizeOrderIds(e,this._provider),K.default(this,e);if(e.kind===s.OrderKind.ASSET_SET_OPERATOR_ORDER)return e=d.normalizeOrderIds(e,this._provider),x.default(this,e);if(e.kind===s.OrderKind.DAPP_VALUE_APPROVE_ORDER)return e=c.normalizeOrderIds(e,this._provider),j.default(this,e);throw new s.ProviderError(s.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED)}))}getContext(){return[{name:"ProxyChange",topic:"0x8edda873a8ad561ecebeb71ceb3ae6bcb70c2b76a3fcb869859895c4d4fc7416",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"index",type:"uint256"},{kind:i.MutationEventTypeKind.NORMAL,name:"proxy",type:"address"}]},{name:"Perform",topic:"0xa4be90ab47bcea0c591eaa7dd28b8ba0329e7ebddac48c5f2ca9fed68d08cf08",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0xe8d9861dbc9c663ed3accd261bbe2fe01e0d3d9e5f51fa38523b265c7757a93a",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"claim",type:"bytes32"}]},{name:"Perform",topic:"0x492318801c2cec532d47019a0b69f83b8d5b499a022b7adb6100a766050644f2",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"createdContract",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]},{name:"Cancel",topic:"0x421b43caf093b5e58d1ea89ca0d80151eda923342cf3cfddf5eb6b30d4947ba0",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"maker",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"taker",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"claim",type:"bytes32"}]}]}createDynamicOrder(e){return(e=JSON.parse(JSON.stringify(e))).signers.push(o.ZERO_ADDRESS),e}}},3105:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyId=t.ProxyKind=void 0,(n=t.ProxyKind||(t.ProxyKind={}))[n.CREATE_ASSET=0]="CREATE_ASSET",n[n.TRANSFER_TOKEN=1]="TRANSFER_TOKEN",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.UPDATE_ASSET=3]="UPDATE_ASSET",n[n.MANAGE_ABILITIES=4]="MANAGE_ABILITIES",n[n.DESTROY_ASSET=5]="DESTROY_ASSET",(r=t.ProxyId||(t.ProxyId={}))[r.XCERT_CREATE=0]="XCERT_CREATE",r[r.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",r[r.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",r[r.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER",r[r.XCERT_UPDATE=4]="XCERT_UPDATE",r[r.MANAGE_ABILITIES=5]="MANAGE_ABILITIES",r[r.XCERT_BURN=6]="XCERT_BURN"},8344:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8096),t),i(r(4794),t),i(r(3105),t)},250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getActionProxy=t.createSignatureTuple=t.createRecipeTuple=t.getActionParams=t.parseAddresses=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353),u=r(3105);function d(e){let t="";return e.forEach((e=>{t+=o.leftPad(e.substr(2),64,"0",!1)})),t}function c(e,t){let r="";const i=t.indexOf(e.senderId);if(-1===i)throw new s.ProviderError(s.ProviderIssue.SENDER_ID_NOT_A_SIGNER);if(e.kind==s.ActionsOrderActionKind.CREATE_ASSET)r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1);else if(e.kind==s.ActionsOrderActionKind.SET_ABILITIES){const t=n.getBitfieldFromAbilities(e.abilities);r=o.leftPad(t,64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)}else e.kind==s.ActionsOrderActionKind.TRANSFER_ASSET?(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.TRANSFER_VALUE?(r=o.leftPad(o.bigNumberify(e.value).toHexString(),64,"0",!0),r+=e.receiverId.substr(2),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT?(r=o.rightPad(`0x${e.assetImprint}`,64),r+=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!1),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1)):e.kind==s.ActionsOrderActionKind.DESTROY_ASSET&&(r=o.leftPad(o.bigNumberify(e.assetId).toHexString(),64,"0",!0),r+=o.leftPad(o.bigNumberify(i).toHexString(),2,"0",!1));return r}function h(e,t){if(t.kind==s.ActionsOrderActionKind.TRANSFER_VALUE)return u.ProxyId.TOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.TRANSFER_ASSET)return-1===e.provider.unsafeRecipientIds.indexOf(t.ledgerId)?u.ProxyId.NFTOKEN_SAFE_TRANSFER:u.ProxyId.NFTOKEN_TRANSFER;if(t.kind==s.ActionsOrderActionKind.CREATE_ASSET)return u.ProxyId.XCERT_CREATE;if(t.kind==s.ActionsOrderActionKind.SET_ABILITIES)return u.ProxyId.MANAGE_ABILITIES;if(t.kind==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT)return u.ProxyId.XCERT_UPDATE;if(t.kind==s.ActionsOrderActionKind.DESTROY_ASSET)return u.ProxyId.XCERT_BURN;throw new s.ProviderError(s.ProviderIssue.ACTION_KIND_NOT_SUPPORTED)}t.createOrderHash=function(e,t){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of t.actions)r=a.keccak256(o.hexToBytes(["0x",r.substr(2),`0000000${h(e,n)}`,n.ledgerId.substr(2),c(n,t.signers).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.actionsOrderId.substr(2),d(t.signers),r.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.parseAddresses=d,t.getActionParams=c,t.createRecipeTuple=function(e,t){const r=t.actions.map((r=>({proxyId:h(e,r),contractAddress:r.ledgerId,params:c(r,t.signers)}))),n={signers:t.signers,actions:r,seed:a.toInteger(t.seed),expirationTimestamp:a.toSeconds(t.expiration)};return a.toTuple(n)},t.createSignatureTuple=function(e){if("string"==typeof e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)}{const t=[];return e.forEach((e=>{const[r,n]=e.split(":"),o=parseInt(r)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:r,s={r:n.substr(0,66),s:`0x${n.substr(66,64)}`,v:parseInt(`0x${n.substr(130,2)}`),k:o};s.v<27&&(s.v=s.v+27),t.push(s)})),a.toTuple(t)}},t.getActionProxy=h,t.normalizeOrderIds=function(e,t){e=JSON.parse(JSON.stringify(e));for(let r=0;r{e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=t.encoder.normalizeAddress(e.receiverId)),e.senderId=t.encoder.normalizeAddress(e.senderId)})):e.actions.forEach((e=>{if(e.ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.senderId=e.senderId?t.encoder.normalizeAddress(e.senderId):e.senderId=o.ZERO_ADDRESS,e.kind!==s.ActionsOrderActionKind.UPDATE_ASSET_IMPRINT&&e.kind!==s.ActionsOrderActionKind.DESTROY_ASSET&&(e.receiverId=e.receiverId?t.encoder.normalizeAddress(e.receiverId):e.receiverId=o.ZERO_ADDRESS,e.senderId===o.ZERO_ADDRESS&&e.receiverId===o.ZERO_ADDRESS))throw new s.ProviderError(s.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING)})),e}},791:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(5291),i=r(3279),o=r(2624),s=r(6112),a=r(5353);function u(e){return o.leftPad(o.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=t.assetLedgerData.capabilities.map((e=>o.rightPad(n.getInterfaceCode(e),64,"0",!1))).join(""),i=a.keccak256(o.hexToBytes(["0x",o.stringToHex(t.assetLedgerData.name),o.stringToHex(t.assetLedgerData.symbol),o.stringToHex(t.assetLedgerData.uriPrefix),o.stringToHex(t.assetLedgerData.uriPostfix),t.assetLedgerData.schemaId,r,t.assetLedgerData.ownerId.substr(2)].join(""))),s=a.keccak256(o.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),u(t.tokenTransferData.value).substr(2)].join("")));return a.keccak256(o.hexToBytes(["0x",e.config.assetLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),i.substr(2),s.substr(2),o.leftPad(a.toInteger(t.seed),64,"0",!1),o.leftPad(a.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=u,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,xcertData:{name:e.assetLedgerData.name,symbol:e.assetLedgerData.symbol,uriPrefix:e.assetLedgerData.uriPrefix,uriPostfix:e.assetLedgerData.uriPostfix,schemaId:`0x${e.assetLedgerData.schemaId}`,capabilities:e.assetLedgerData.capabilities.map((e=>n.getInterfaceCode(e))),owner:e.assetLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:u(e.tokenTransferData.value)},seed:a.toInteger(e.seed),expirationTimestamp:a.toSeconds(e.expiration)};return a.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),n=parseInt(t)==i.SignMethod.PERSONAL_SIGN?i.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:n};return o.v<27&&(o.v=o.v+27),a.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=o.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new s.ProviderError(s.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=o.ZERO_ADDRESS}return e.assetLedgerData.ownerId=t.encoder.normalizeAddress(e.assetLedgerData.ownerId),e}},48:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.owner.substr(2),e.operator.substr(2),e.isOperator?"01":"00",e.tokenTransferData.ledgerId.substr(2),s(e.tokenTransferData.value).substr(2),e.tokenTransferData.receiverId.substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.owner,e.operator,e.isOperator,e.tokenTransferData.ledgerId,s(e.tokenTransferData.value),e.tokenTransferData.receiverId,o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.owner=t.encoder.normalizeAddress(e.owner),e.operator=t.encoder.normalizeAddress(e.operator),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId=e.tokenTransferData.receiverId?t.encoder.normalizeAddress(e.tokenTransferData.receiverId):i.ZERO_ADDRESS,e}},3365:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.getOrderInputParams=t.createSignatureTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(5353);function s(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e){return o.keccak256(i.hexToBytes(["0x",e.ledgerId.substr(2),e.approver.substr(2),e.spender.substr(2),s(e.value).substr(2),e.feeRecipient.substr(2),s(e.feeValue).substr(2),i.leftPad(o.toInteger(e.seed),64,"0",!1),i.leftPad(o.toSeconds(e.expiration),64,"0",!1)].join("")))},t.getValue=s,t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,s={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return s.v<27&&(s.v=s.v+27),o.toTuple(s)},t.getOrderInputParams=function(e){return[e.approver,e.spender,s(e.value),e.feeRecipient,s(e.feeValue),o.toInteger(e.seed),o.toSeconds(e.expiration)]},t.normalizeOrderIds=function(e,t){return(e=JSON.parse(JSON.stringify(e))).ledgerId=t.encoder.normalizeAddress(e.ledgerId),e.approver=t.encoder.normalizeAddress(e.approver),e.spender=t.encoder.normalizeAddress(e.spender),e.feeRecipient=e.feeRecipient?t.encoder.normalizeAddress(e.feeRecipient):i.ZERO_ADDRESS,e}},7139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeOrderIds=t.createSignatureTuple=t.createRecipeTuple=t.getValue=t.createOrderHash=void 0;const n=r(3279),i=r(2624),o=r(6112),s=r(5353);function a(e){return i.leftPad(i.bigNumberify(e).toHexString(),64,"0",!0)}t.createOrderHash=function(e,t){const r=s.keccak256(i.hexToBytes(["0x",i.stringToHex(t.valueLedgerData.name),i.stringToHex(t.valueLedgerData.symbol),a(t.valueLedgerData.supply).substr(2),i.leftPad(i.bigNumberify(t.valueLedgerData.decimals).toHexString(),2,"0",!1),t.valueLedgerData.ownerId.substr(2)].join(""))),n=s.keccak256(i.hexToBytes(["0x",t.tokenTransferData.ledgerId.substr(2),t.tokenTransferData.receiverId.substr(2),a(t.tokenTransferData.value).substr(2)].join("")));return s.keccak256(i.hexToBytes(["0x",e.config.valueLedgerDeployOrderId.substr(2),t.makerId.substr(2),t.takerId.substr(2),r.substr(2),n.substr(2),i.leftPad(s.toInteger(t.seed),64,"0",!1),i.leftPad(s.toSeconds(t.expiration),64,"0",!1)].join("")))},t.getValue=a,t.createRecipeTuple=function(e){const t={maker:e.makerId,taker:e.takerId,tokenData:{name:e.valueLedgerData.name,symbol:e.valueLedgerData.symbol,supply:e.valueLedgerData.supply,decimals:e.valueLedgerData.decimals,owner:e.valueLedgerData.ownerId},transferData:{token:e.tokenTransferData.ledgerId,to:e.tokenTransferData.receiverId,value:a(e.tokenTransferData.value)},seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(t)},t.createSignatureTuple=function(e){const[t,r]=e.split(":"),i=parseInt(t)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:t,o={r:r.substr(0,66),s:`0x${r.substr(66,64)}`,v:parseInt(`0x${r.substr(130,2)}`),k:i};return o.v<27&&(o.v=o.v+27),s.toTuple(o)},t.normalizeOrderIds=function(e,t){let r=!1;if((e=JSON.parse(JSON.stringify(e))).takerId?e.takerId=t.encoder.normalizeAddress(e.takerId):(e.takerId=i.ZERO_ADDRESS,r=!0),e.makerId=t.encoder.normalizeAddress(e.makerId),e.tokenTransferData.ledgerId=t.encoder.normalizeAddress(e.tokenTransferData.ledgerId),e.tokenTransferData.receiverId)e.tokenTransferData.receiverId=t.encoder.normalizeAddress(e.tokenTransferData.receiverId);else{if(!r)throw new o.ProviderError(o.ProviderIssue.NO_RECEIVER_ID);e.tokenTransferData.receiverId=i.ZERO_ADDRESS}return e.valueLedgerData.ownerId=t.encoder.normalizeAddress(e.valueLedgerData.ownerId),e}},8768:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(e,t),n={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0x38a9bfcd"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},3665:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(250),s=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)","tuple[](bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createRecipeTuple(e,t),a=o.createSignatureTuple(r),u={from:e.provider.accountId,to:e.config.actionsOrderId,data:"0xb438bae1"+e.provider.encoder.encodeParameters(s,[n,a]).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},9610:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(791),s=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:"0x9ebbc600"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5391:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(791),a=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0xef48e40c":"0xb2a9e276",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.assetLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},7172:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t),n={from:e.provider.accountId,to:t.ledgerId,data:"0xce4e3273"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8634:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(48),s=["address","address","bool","address","uint256","address","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x7f9b45b0"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},7045:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","uint256","address","uint256","uint256","uint256"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.getOrderInputParams(t);r.shift();const n={from:e.provider.accountId,to:t.ledgerId,data:"0xeb92ad66"+e.provider.encoder.encodeParameters(s,r).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},5636:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(3365),s=["address","address","uint256","address","uint256","uint256","uint256","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=o.createSignatureTuple(r),a=o.getOrderInputParams(t);a.push(n);const u={from:e.provider.accountId,to:t.ledgerId,data:"0x5d19eb86"+e.provider.encoder.encodeParameters(s,a).substr(2)},d=yield e.provider.post({method:"eth_sendTransaction",params:[u]});return new i.Mutation(e.provider,d.result,e)}))}},6075:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(7139),s=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=o.createRecipeTuple(t),n={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:"0x4e4631e7"+e.provider.encoder.encodeParameters(s,[r]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},8608:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(2624),s=r(7139),a=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=t.takerId===o.ZERO_ADDRESS?"0x38d7d25c":"0x15f0a1a6",u=s.createRecipeTuple(t),d=s.createSignatureTuple(r),c={from:e.provider.accountId,to:e.config.valueLedgerDeployOrderId,data:n+e.provider.encoder.encodeParameters(a,[u,d]).substr(2)},h=yield e.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(e.provider,h.result,e)}))}},1785:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7461:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},2746:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["tuple(address[], tuple[](uint32, address, bytes), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(e,t);try{const t={to:e.config.actionsOrderId,data:"0x5f2aa503"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},3924:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["uint8"],i=["address"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.config.actionsOrderId,data:"0xabd90f85"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0]}catch(t){return e.provider.log(t),null}}))}},5434:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(250),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r,a){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),u=i.createSignatureTuple(r);try{const t={to:e.config.actionsOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[a,n,u]).substr(2)},r=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return e.provider.log(t),null}}))}},6651:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},8453:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},9085:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["tuple(address, address, tuple(string, string, string, string, bytes32, bytes4[], address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.assetLedgerDeployOrderId,data:"0x30d6f0fa"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},9626:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(791),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.assetLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},1006:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},2255:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},8082:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","address","bool","address","uint256","address","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0xa0fd4195"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},4997:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(48),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.owner,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},6389:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},7008:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},1399:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","address","uint256","address","uint256","uint256","uint256"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.getOrderInputParams(t);try{const n={to:t.ledgerId,data:"0x680f36e2"+e.provider.encoder.encodeParameters(o,r).substr(2)},i=yield e.provider.post({method:"eth_call",params:[n,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},9156:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3365),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createSignatureTuple(r),a=i.createOrderHash(t);try{const r={to:t.ledgerId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.approver,a,n]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},3022:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"eth_sign",params:[e.provider.accountId,r]});return`${e.provider.signMethod}:${n.result}`}))}},9669:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139);t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createOrderHash(e,t),n=yield e.provider.post({method:"personal_sign",params:[r,e.provider.accountId,null]});return`${e.provider.signMethod}:${n.result}`}))}},7734:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["tuple(address, address, tuple(string, string, uint256, uint8, address), tuple(address, address, uint256), uint256, uint256)"],s=["bytes32"];t.default=function(e,t){return n(this,void 0,void 0,(function*(){const r=i.createRecipeTuple(t);try{const t={to:e.config.valueLedgerDeployOrderId,data:"0xc11e8b7a"+e.provider.encoder.encodeParameters(o,[r]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[t,"latest"]});return e.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return e.provider.log(t),null}}))}},4909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(7139),o=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],s=["bool"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n=i.createOrderHash(e,t),a=i.createSignatureTuple(r);try{const r={to:e.config.valueLedgerDeployOrderId,data:"0x8fa76d8d"+e.provider.encoder.encodeParameters(o,[t.makerId,n,a]).substr(2)},i=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(s,i.result)[0]}catch(t){return e.provider.log(t),null}}))}},2143:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseError=void 0;const n=r(6112);t.parseError=function(e){return e instanceof n.ProviderError?e:Object.values(n.ProviderIssue).includes(e)?new n.ProviderError(e):new n.ProviderError(n.ProviderIssue.CONTRACT_ERROR,e)}},2072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildGatewayConfig=void 0;const n=r(6898);t.buildGatewayConfig=function(e){switch(e){case n.NetworkKind.LIVE:return{actionsOrderId:"0x800ecA21614dA02Df076981Bca9c664dBE19089A",assetLedgerDeployOrderId:"0x984e781a6C09b433493767755f7b072183Ce7BfF",valueLedgerDeployOrderId:"0x9118bd4230EAb074f98527658f3649aA26420568"};case n.NetworkKind.RINKEBY:return{actionsOrderId:"0xF8254F1B119Cd263b066912B3Cb4FE568f580b6c",assetLedgerDeployOrderId:"0xC9F667603300390BCF8C4Fb5688d755811F34Da5",valueLedgerDeployOrderId:"0xA02121436e9307f9e369e188941b731D79c4DD7d"};case n.NetworkKind.ROPSTEN:return{actionsOrderId:"0xbb719e35c67198e4453923eeccF0c678C6129982",assetLedgerDeployOrderId:"0xC94284591B312c5551329F868420dec03C9044f8",valueLedgerDeployOrderId:"0xD348c4D9BE9585295891E0322FeFe58009c1514C"};default:throw new Error("Unsupported network kind.")}}},1868:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Mutation=t.MutationStatus=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(6898);var u;!function(e){e[e.INITIALIZED=0]="INITIALIZED",e[e.PENDING=1]="PENDING",e[e.COMPLETED=2]="COMPLETED"}(u=t.MutationStatus||(t.MutationStatus={}));class d extends s.EventEmitter{constructor(e,t,r){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._logs=[],this._id=t,this._provider=e,this._provider.sandbox&&(this._status=u.COMPLETED),this._context=r}get id(){return this._id}get provider(){return this._provider}get confirmations(){return this._confirmations}get senderId(){return this._senderId}get receiverId(){return this._receiverId}get logs(){return this._logs}isPending(){return this._status===u.PENDING}isCompleted(){return this._status===u.COMPLETED}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}complete(){return n(this,void 0,void 0,(function*(){const e=this._status===u.INITIALIZED;return this.isCompleted()?this.resolveCurrentState():(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise(((t,r)=>{this.isCompleted()?t(null):(this.once(o.MutationEvent.COMPLETE,(()=>t(null))),this.once(o.MutationEvent.ERROR,(e=>r(e)))),e&&this.loopUntilCompleted()})),this)}))}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}resolve(){return n(this,void 0,void 0,(function*(){return this.resolveCurrentState()}))}retry(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");const t=yield this._provider.post({method:"eth_gasPrice",params:[]}),r=e.gasPrice,n=t.result*this._provider.retryGasPriceMultiplier,i=n>=r?n:r*this._provider.retryGasPriceMultiplier,o={from:e.from,data:e.input,nonce:e.nonce,value:e.value,gas:e.gas,gasPrice:`0x${Math.ceil(i).toString(16)}`};e.to&&(o.to=e.to);const s=yield this._provider.post({method:"eth_sendTransaction",params:[o]});this._id=s.result}))}cancel(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e)throw new Error("Mutation not found");if(e.blockNumber)throw new Error("Mutation already accepted onto the blockchain");if(e.from.toLowerCase()!==this._provider.accountId.toLowerCase())throw new Error("You are not the maker of this mutation so you cannot cancel it.");const t=`0x${Math.ceil(1.1*e.gasPrice).toString(16)}`,r={from:e.from,to:e.from,nonce:e.nonce,value:"0x0",gasPrice:t},n=yield this._provider.post({method:"eth_sendTransaction",params:[r]});this._id=n.result}))}resolveCurrentState(){return n(this,void 0,void 0,(function*(){const e=yield this.getTransactionObject();if(!e||e.to&&"0x0"!==e.to||(e.to=yield this.getTransactionReceipt().then((e=>e?e.contractAddress:null))),e&&e.to){if(this._senderId=i.normalizeAddress(e.from),this._receiverId=i.normalizeAddress(e.to),this._confirmations=yield this.getLastBlock().then((t=>t-parseInt(e.blockNumber||t))).then((e=>e<0?0:e)),this._confirmations>=this._provider.requiredConfirmations)return yield this.parseLogs(),this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}}))}loopUntilCompleted(){return n(this,void 0,void 0,(function*(){yield this.resolveCurrentState(),-1===this._provider.mutationTimeout||Date.now()-this._started{const r=e.find((e=>e.topic===t.topics[0]));if(!r)return void this._provider.log(JSON.stringify(t));const n={};n.event=r.name,n.address=t.address;const i=r.types.filter((e=>e.kind===a.MutationEventTypeKind.NORMAL)),o=r.types.filter((e=>e.kind===a.MutationEventTypeKind.INDEXED));if(i.length>0){const e=i.map((e=>e.type)),r=this._provider.encoder.decodeParameters(e,t.data);i.forEach(((e,t)=>{n[e.name]=r[t]}))}o.forEach(((e,r)=>{n[e.name]=this._provider.encoder.decodeParameters([e.type],t.topics[r+1])[0]})),this._logs.push(n)}))}catch(e){this._provider.log(e)}}))}}t.Mutation=d},1623:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.GenericProvider=void 0;const i=r(2624),o=r(6112),s=r(7533),a=r(2143),u=r(6898);class d extends s.EventEmitter{constructor(e){super(),this._id=0,this.encoder=void 0!==e.encoder?e.encoder:new i.Encoder,this.accountId=e.accountId,this.gatewayConfig=e.gatewayConfig,this.unsafeRecipientIds=e.unsafeRecipientIds,this.assetLedgerSource=e.assetLedgerSource||"https://conventions.0xcert.org/ethereum/xcert-mock.json",this.valueLedgerSource=e.valueLedgerSource||"https://conventions.0xcert.org/ethereum/token-mock.json",this.signMethod=void 0!==e.signMethod?e.signMethod:u.SignMethod.ETH_SIGN,this.requiredConfirmations=void 0!==e.requiredConfirmations?e.requiredConfirmations:1,this.mutationTimeout=void 0!==e.mutationTimeout?e.mutationTimeout:36e5,this.gasPriceMultiplier=void 0!==e.gasPriceMultiplier?e.gasPriceMultiplier:1.1,this.retryGasPriceMultiplier=void 0!==e.retryGasPriceMultiplier?e.retryGasPriceMultiplier:2,this.sandbox=void 0!==e.sandbox&&e.sandbox,this.verbose=void 0!==e.verbose&&e.verbose,this._client=e.client&&e.client.currentProvider?e.client.currentProvider:e.client}log(e){this.verbose&&console.log(e)}get accountId(){return this._accountId||null}set accountId(e){e=this.encoder.normalizeAddress(e),this.isCurrentAccount(e)||this.emit(o.ProviderEvent.ACCOUNT_CHANGE,e,this._accountId),this._accountId=e}get unsafeRecipientIds(){return this._unsafeRecipientIds||[]}set unsafeRecipientIds(e){this._unsafeRecipientIds=(e||[]).map((e=>this.encoder.normalizeAddress(e)))}get gatewayConfig(){return this._gatewayConfig}set gatewayConfig(e){this._gatewayConfig=void 0!==e?{actionsOrderId:this.encoder.normalizeAddress(e.actionsOrderId),assetLedgerDeployOrderId:this.encoder.normalizeAddress(e.assetLedgerDeployOrderId),valueLedgerDeployOrderId:this.encoder.normalizeAddress(e.valueLedgerDeployOrderId)}:null}emit(...e){return super.emit.call(this,...e),this}on(...e){return super.on.call(this,...e),this}once(...e){return super.once.call(this,...e),this}off(e,t){return t?super.off(e,t):super.removeAllListeners(e),this}sign(e){return n(this,void 0,void 0,(function*(){if(!this.accountId)throw new Error("accountId not set.");if(this.signMethod===u.SignMethod.PERSONAL_SIGN)return(yield this.post({method:"personal_sign",params:[e,this.accountId,null]})).result;if(this.signMethod===u.SignMethod.ETH_SIGN)return(yield this.post({method:"eth_sign",params:[this.accountId,e]})).result;throw new Error("Signing method not implemented.")}))}getAvailableAccounts(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map((e=>this.encoder.normalizeAddress(e)))}))}getNetworkVersion(){return n(this,void 0,void 0,(function*(){return(yield this.post({method:"net_version",params:[]})).result}))}isCurrentAccount(e){return this.accountId===this.encoder.normalizeAddress(e)}isUnsafeRecipientId(e){const t=this.encoder.normalizeAddress(e);return!!this.unsafeRecipientIds.find((e=>e===t))}post(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({},e);if("eth_sendTransaction"===t.method&&t.params.length&&(this.sandbox||void 0===t.params[0].gas)){try{const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_estimateGas"}));t.params[0].gas=`0x${Math.ceil(1.1*e.result).toString(16)}`}catch(e){if(e&&e.original&&(-32603===e.original.code||-32e3===e.original.code)){t.params.push("latest");const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_call"}));throw new o.ProviderError(o.ProviderIssue.CONTRACT_ERROR,e.result)}throw e}if(this.sandbox)return{id:null,jsonrpc:null,result:t.params[0].gas};if(void 0===t.params[0].gasPrice){const e=yield this.request(Object.assign(Object.assign({},t),{method:"eth_gasPrice",params:[]}));t.params[0].gasPrice=`0x${Math.ceil(e.result*this.gasPriceMultiplier).toString(16)}`}}return this.request(t)}))}request(e){return n(this,void 0,void 0,(function*(){const t=Object.assign({jsonrpc:"2.0",id:e.id||this.getNextId(),params:[]},e);return new Promise(((e,r)=>{this._client.send(t,((n,i)=>n?(this.log(n),r(n)):i.error?(this.log(n),r(i.error)):i.id!==t.id?r("Invalid RPC id"):e(i)))})).catch((e=>{throw new o.ProviderError(o.ProviderIssue.GENERAL,e)})).then((e=>{if("eth_call"===t.method&&e&&e.result&&-1!==e.result.indexOf("0x08c379a0")){const t=this.encoder.decodeParameters(["string"],`0x${e.result.substring(10)}`);throw a.parseError(t[0])}return e}))}))}getNextId(){return this._id++,this._id}}t.GenericProvider=d},6898:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.NetworkKind=t.MutationEventTypeKind=t.SignMethod=void 0,(i=t.SignMethod||(t.SignMethod={}))[i.ETH_SIGN=0]="ETH_SIGN",i[i.TREZOR=1]="TREZOR",i[i.NO_PREFIX=2]="NO_PREFIX",i[i.PERSONAL_SIGN=3]="PERSONAL_SIGN",(n=t.MutationEventTypeKind||(t.MutationEventTypeKind={}))[n.NORMAL=0]="NORMAL",n[n.INDEXED=1]="INDEXED",(r=t.NetworkKind||(t.NetworkKind={}))[r.LIVE=0]="LIVE",r[r.ROPSTEN=1]="ROPSTEN",r[r.RINKEBY=2]="RINKEBY"},3279:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8330),t),i(r(677),t),i(r(2143),t),i(r(1868),t),i(r(1623),t),i(r(6898),t),i(r(2072),t)},2624:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(7203),t),i(r(881),t),i(r(1402),t),i(r(9030),t),i(r(3690),t),i(r(7170),t),i(r(3710),t),i(r(2057),t),i(r(9555),t),i(r(1389),t)},7203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decodeParameters=t.encodeParameters=void 0;const n=new(r(861).AbiCoder);t.encodeParameters=function(e,t){return n.encode(e,t)},t.decodeParameters=function(e,t){return n.decode(e,t)}},1402:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.bigNumberify=t.BigNumber=void 0;const n=r(2069);var i=r(2069);Object.defineProperty(t,"BigNumber",{enumerable:!0,get:function(){return i.BigNumber}}),t.bigNumberify=function(e){return n.bigNumberify(e)}},9030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Encoder=void 0;const n=r(861),i=r(2990);t.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(e,t){return this.coder.encode(e,t)}decodeParameters(e,t){return this.coder.decode(e,t)}normalizeAddress(e){return e?i.getAddress(e):null}}},3690:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hexToBytes=void 0,t.hexToBytes=function(e){e=e.toString(16).replace(/^0x/i,"");const t=[];for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.leftPad=void 0,t.leftPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+e}},881:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.normalizeAddress=void 0;const n=r(2990);t.normalizeAddress=function(e){return e?n.getAddress(e.toLowerCase()):null}},3710:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.rightPad=void 0,t.rightPad=function(e,t,r,n){const i=void 0===n?/^0x/i.test(e)||"number"==typeof e:n,o=t-(e=e.toString(16).replace(/^0x/i,"")).length+1>=0?t-e.length+1:0;return(i?"0x":"")+e+new Array(o).join(r||"0")}},2057:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.stringToHex=void 0,t.stringToHex=function(e){let t="";for(let r=0;r{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ZERO_ADDRESS=void 0,t.ZERO_ADDRESS="0x0000000000000000000000000000000000000000"},1389:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},8218:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const i=r(3279),o=r(2624),s=r(6112),a=r(646),u=r(1225),d=r(6512),c=r(7061),h=r(3919),l=r(8926),f=r(2328);t.ValueLedger=class{constructor(e,t){this._provider=e,this._id=this._provider.encoder.normalizeAddress(t)}static deploy(e,t){return n(this,void 0,void 0,(function*(){return u.default(e,t)}))}static getInstance(e,t){return new this(e,t)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(e,t){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),t=this._provider.encoder.normalizeAddress(t),h.default(this,e,t)}))}getBalance(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),l.default(this,e)}))}getInfo(){return n(this,void 0,void 0,(function*(){return f.default(this)}))}isApprovedValue(e,t,r){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,t,r);return o.bigNumberify(n).gte(o.bigNumberify(e))}))}approveValue(e,t){return n(this,void 0,void 0,(function*(){t=this._provider.encoder.normalizeAddress(t);const r=yield this.getApprovedValue(this.provider.accountId,t);if(!o.bigNumberify(e).isZero()&&!o.bigNumberify(r).isZero())throw new s.ProviderError(s.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION);return a.default(this,t,e)}))}disapproveValue(e){return n(this,void 0,void 0,(function*(){return e=this._provider.encoder.normalizeAddress(e),a.default(this,e,"0")}))}transferValue(e){return n(this,void 0,void 0,(function*(){const t=this._provider.encoder.normalizeAddress(e.senderId),r=this._provider.encoder.normalizeAddress(e.receiverId);return e.senderId?c.default(this,t,r,e.value):d.default(this,r,e.value)}))}getContext(){return[{name:"Transfer",topic:"0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"from",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"to",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]},{name:"Approval",topic:"0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925",types:[{kind:i.MutationEventTypeKind.INDEXED,name:"owner",type:"address"},{kind:i.MutationEventTypeKind.INDEXED,name:"spender",type:"address"},{kind:i.MutationEventTypeKind.NORMAL,name:"value",type:"uint256"}]}]}}},5508:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(8218),t)},646:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x095ea7b3"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},1225:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=r(5353),s=["string","string","uint8","uint256"];t.default=function(e,{name:t,symbol:r,decimals:a,supply:u}){return n(this,void 0,void 0,(function*(){const n=(yield o.fetchJson(e.valueLedgerSource)).TokenMock.evm.bytecode.object,d={from:e.accountId,data:`0x${n}${e.encoder.encodeParameters(s,[t,r,a,u]).substr(2)}`},c=yield e.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(e,c.result)}))}},7061:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","address","uint256"];t.default=function(e,t,r,s){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0x23b872dd"+e.provider.encoder.encodeParameters(o,[t,r,s]).substr(2)},a=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,a.result,e)}))}},6512:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const i=r(3279),o=["address","uint256"];t.default=function(e,t,r){return n(this,void 0,void 0,(function*(){const n={from:e.provider.accountId,to:e.id,data:"0xa9059cbb"+e.provider.encoder.encodeParameters(o,[t,r]).substr(2)},s=yield e.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(e.provider,s.result,e)}))}},3919:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address","address"],i=["uint256"];t.default=function(e,t,o){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0xdd62ed3e"+e.provider.encoder.encodeParameters(n,[t,o]).substr(2)},s=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,s.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},8926:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=["address"],i=["uint256"];t.default=function(e,t){return r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:"0x70a08231"+e.provider.encoder.encodeParameters(n,[t]).substr(2)},o=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(i,o.result)[0].toString()}catch(t){return e.provider.log(t),null}}))}},2328:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0});const n=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0x313ce567",inputTypes:[],outputTypes:["uint8"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];t.default=function(e){return r(this,void 0,void 0,(function*(){const t=yield Promise.all(n.map((t=>r(this,void 0,void 0,(function*(){try{const r={to:e.id,data:t.signature+e.provider.encoder.encodeParameters(t.inputTypes,[]).substr(2)},n=yield e.provider.post({method:"eth_call",params:[r,"latest"]});return e.provider.encoder.decodeParameters(t.outputTypes,n.result)[0].toString()}catch(t){return e.provider.log(t),null}})))));return{name:t[0],symbol:t[1],decimals:t[2],supply:t[3]}}))}},5836:function(e,t){"use strict";var r,n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Merkle=t.MerkleHasherPosition=void 0,function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(r=t.MerkleHasherPosition||(t.MerkleHasherPosition={})),t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,r){return this._options.hasher(e,t,r)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return n(this,void 0,void 0,(function*(){const n=[...e],i=[],o=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(o,[...t,n.length],r.NODE)];for(let e=n.length-1;e>=0;e--){const o=s[0];i.unshift(yield this._options.noncer([...t,e]));const a=yield this._options.hasher(n[e],[...t,e],r.VALUE);s.unshift(yield this._options.hasher(`${a}${i[0]}`,[...t,e],r.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${o}`,[...t,e],r.NODE))}return{values:n.map(((e,t)=>({index:t,value:e,nonce:i[t]}))),nodes:s.map(((e,t)=>({index:t,hash:e})))}}))}disclose(e,t){return n(this,void 0,void 0,(function*(){const r=Math.max(...t.map((e=>e+1)),0),n=[],i=[e.nodes.find((e=>e.index===2*r))];for(let o=r-1;o>=0;o--)-1!==t.indexOf(o)?n.unshift(e.values.find((e=>e.index===o))):i.unshift(e.nodes.find((e=>e.index===2*o+1)));return{values:n,nodes:i}}))}imprint(e){return n(this,void 0,void 0,(function*(){const t=[...yield Promise.all(e.values.map(((e,t)=>n(this,void 0,void 0,(function*(){const n=yield this._options.hasher(e.value,[t],r.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],r.LEAF),value:e.value}}))))),...e.nodes];for(let e=Math.max(...t.map((e=>e.index+1)),0)-1;e>=0;e-=2){const n=t.find((t=>t.index===e)),i=t.find((t=>t.index===e-1));n&&i&&t.unshift({index:e-2,hash:yield this._options.hasher(`${i.hash}${n.hash}`,[e],r.NODE)})}const i=t.find((e=>0===e.index));return i?i.hash:null}))}}},2461:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(5836),t)},4508:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1340:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0,(i=t.GeneralAssetLedgerAbility||(t.GeneralAssetLedgerAbility={}))[i.CREATE_ASSET=16]="CREATE_ASSET",i[i.REVOKE_ASSET=32]="REVOKE_ASSET",i[i.TOGGLE_TRANSFERS=64]="TOGGLE_TRANSFERS",i[i.UPDATE_ASSET=128]="UPDATE_ASSET",i[i.UPDATE_URI_BASE=256]="UPDATE_URI_BASE",i[i.ALLOW_CREATE_ASSET=512]="ALLOW_CREATE_ASSET",i[i.ALLOW_UPDATE_ASSET_IMPRINT=1024]="ALLOW_UPDATE_ASSET_IMPRINT",(n=t.SuperAssetLedgerAbility||(t.SuperAssetLedgerAbility={}))[n.MANAGE_ABILITIES=1]="MANAGE_ABILITIES",n[n.ALLOW_MANAGE_ABILITIES=2]="ALLOW_MANAGE_ABILITIES",(r=t.AssetLedgerCapability||(t.AssetLedgerCapability={}))[r.DESTROY_ASSET=1]="DESTROY_ASSET",r[r.UPDATE_ASSET=2]="UPDATE_ASSET",r[r.REVOKE_ASSET=4]="REVOKE_ASSET",r[r.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"},8096:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedgerDeployOrder=t.AssetLedgerDeployOrder=t.SignedFixedActionsOrder=t.FixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.AssetSetOperatorOrder=t.DappValueApproveOrder=t.OrderKind=t.ActionsOrderActionKind=void 0,(n=t.ActionsOrderActionKind||(t.ActionsOrderActionKind={}))[n.CREATE_ASSET=1]="CREATE_ASSET",n[n.TRANSFER_ASSET=2]="TRANSFER_ASSET",n[n.TRANSFER_VALUE=3]="TRANSFER_VALUE",n[n.UPDATE_ASSET_IMPRINT=4]="UPDATE_ASSET_IMPRINT",n[n.SET_ABILITIES=5]="SET_ABILITIES",n[n.DESTROY_ASSET=6]="DESTROY_ASSET",(r=t.OrderKind||(t.OrderKind={}))[r.ASSET_LEDGER_DEPLOY_ORDER=1]="ASSET_LEDGER_DEPLOY_ORDER",r[r.VALUE_LEDGER_DEPLOY_ORDER=2]="VALUE_LEDGER_DEPLOY_ORDER",r[r.FIXED_ACTIONS_ORDER=3]="FIXED_ACTIONS_ORDER",r[r.DYNAMIC_ACTIONS_ORDER=4]="DYNAMIC_ACTIONS_ORDER",r[r.SIGNED_FIXED_ACTIONS_ORDER=5]="SIGNED_FIXED_ACTIONS_ORDER",r[r.SIGNED_DYNAMIC_ACTIONS_ORDER=6]="SIGNED_DYNAMIC_ACTIONS_ORDER",r[r.ASSET_SET_OPERATOR_ORDER=7]="ASSET_SET_OPERATOR_ORDER",r[r.DAPP_VALUE_APPROVE_ORDER=8]="DAPP_VALUE_APPROVE_ORDER",t.DappValueApproveOrder=class{},t.AssetSetOperatorOrder=class{},t.DynamicActionsOrder=class{},t.SignedDynamicActionsOrder=class{},t.FixedActionsOrder=class{},t.SignedFixedActionsOrder=class{},t.AssetLedgerDeployOrder=class{},t.ValueLedgerDeployOrder=class{}},2503:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderIssue=void 0,(r=t.ProviderIssue||(t.ProviderIssue={})).GENERAL="0",r.CONTRACT_ERROR="1",r.ACTIONS_ORDER_KIND_NOT_SUPPORTED="5000001",r.DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000002",r.FIXED_ACTIONS_ORDER_SIGNATURES="5000003",r.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES="5000004",r.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES="5000005",r.NO_RECEIVER_ID="5000006",r.PROXY_KIND_NOT_SUPPORTED="5000007",r.SENDER_ID_NOT_A_SIGNER="5000008",r.SENDER_ID_AND_RECEIVER_ID_MISSING="5000009",r.ACTION_KIND_NOT_SUPPORTED="5000010",r.ERC20_APPROVAL_RACE_CONDITION="5000011",r.ERC20_NOT_ENOUGH_BALANCE="001001",r.ERC20_NOT_ENOUGH_ALLOWANCE="001002",r.ERC721_ZERO_ADDRESS="003001",r.ERC721_NOT_VALID_NFT="003002",r.ERC721_NOT_OWNER_OR_OPERATOR="003003",r.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR="003004",r.ERC721_NOT_ABLE_TO_RECEIVE_NFT="003005",r.ERC721_NFT_ALREADY_EXISTS="003006",r.ERC721_METADATA_ZERO_ADDRESS="004001",r.ERC721_METADATA_NOT_VALID_NFT="004002",r.ERC721_METADATA_NOT_OWNER_OR_OPERATOR="004003",r.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR="004004",r.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT="004005",r.ERC721_METADATA_NFT_ALREADY_EXISTS="004006",r.ERC721_ENUMERABLE_ZERO_ADDRESS="005001",r.ERC721_ENUMERABLE_NOT_VALID_NFT="005002",r.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR="005003",r.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="005004",r.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="005005",r.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS="005006",r.ERC721_ENUMERABLE_INVALID_INDEX="005007",r.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS="006001",r.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT="006002",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR="006003",r.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR="006004",r.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT="006005",r.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS="006006",r.ERC721_METADATA_ENUMERABLE_INVALID_INDEX="006007",r.XCERT_CAPABILITY_NOT_SUPPORTED="007001",r.XCERT_TRANSFERS_DISABLED="007002",r.XCERT_NOT_VALID_XCERT="007003",r.XCERT_NOT_OWNER_OR_OPERATOR="007004",r.XCERT_INVALID_SIGNATURE="007005",r.XCERT_INVALID_SIGNATURE_KIND="007006",r.XCERT_CLAIM_PERFORMED="007007",r.XCERT_CLAIM_EXPIRED="007008",r.XCERT_CLAIM_CANCELED="007009",r.XCERT_NOT_OWNER="007010",r.SAFE_MATH_OVERFLOW="008001",r.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND="008002",r.SAFE_MATH_DIVISION_BY_ZERO="008003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="009001",r.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="009002",r.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED="009003",r.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE="009004",r.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED="009005",r.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="009006",r.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="009007",r.DAPP_TOKEN_NOT_ENOUGH_BALANCE="010001",r.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE="010002",r.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS="010003",r.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED="010004",r.DAPP_TOKEN_MIGRATION_STARTED="010005",r.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE="010006",r.DAPP_TOKEN_INVALID_SIGNATURE="010007",r.DAPP_TOKEN_CLAIM_PERFORMED="010008",r.DAPP_TOKEN_CLAIM_EXPIRED="010009",r.DAPP_TOKEN_INVALID_SIGNATURE_KIND="010010",r.DAPP_TOKEN_CLAIM_CANCELED="010011",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND="011001",r.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER="011002",r.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED="011003",r.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE="011004",r.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED="011005",r.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED="011006",r.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER="011007",r.ERC20_TRANSFER_PROXY_TRANSFER_FAILED="012001",r.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND="015001",r.ACTIONS_GATEWAY_INVALID_PROXY="015002",r.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER="015003",r.ACTIONS_GATEWAY_CLAIM_EXPIRED="015004",r.ACTIONS_GATEWAY_INVALID_SIGNATURE="015005",r.ACTIONS_GATEWAY_ORDER_CANCELED="015006",r.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED="015007",r.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER="015008",r.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY="015009",r.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY="015010",r.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY="015011",r.SIGNER_IS_NOT_DESTROY_ASSET_OWNER="015012",r.ABILITABLE_NOT_AUTHORIZED="017001",r.ABILITABLE_INVALID_INPUT="017002",r.OWNABLE_NOT_OWNER="018001",r.OWNABLE_ZERO_ADDRESS="018002",r.CLAIMABLE_NOT_PENDING_OWNER="019001"},1414:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});const n=r(2503);t.default={[n.ProviderIssue.ACTIONS_ORDER_KIND_NOT_SUPPORTED]:"Actions order kind not supported.",[n.ProviderIssue.DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_DYNAMIC_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_DYNAMIC_ACTIONS_ORDER kind.",[n.ProviderIssue.SIGNED_FIXED_ACTIONS_ORDER_SIGNATURES]:"Amount of signature not consistent with signers for SIGNED_FIXED_ACTIONS_ORDER kind.",[n.ProviderIssue.NO_RECEIVER_ID]:"ReceiverId is not set.",[n.ProviderIssue.PROXY_KIND_NOT_SUPPORTED]:"Invalid proxy kind.",[n.ProviderIssue.SENDER_ID_NOT_A_SIGNER]:"SenderId is not a signer.",[n.ProviderIssue.SENDER_ID_AND_RECEIVER_ID_MISSING]:"Both senderId and receiverId are missing.",[n.ProviderIssue.ACTION_KIND_NOT_SUPPORTED]:"Not implemented.",[n.ProviderIssue.ERC20_APPROVAL_RACE_CONDITION]:"First set approval to 0. ERC-20 token potential attack.",[n.ProviderIssue.ERC20_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.ERC20_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.ERC721_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_VALID_NFT]:"Asset with this ID does not exist.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_OWNER_APPROWED_OR_OPERATOR]:"Sender is neither asset owner, approved nor operator.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NOT_ABLE_TO_RECEIVE_NFT]:"Receiver is not able to safely receive the asset.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_NFT_ALREADY_EXISTS]:"Asset with provided ID already exists.",[n.ProviderIssue.ERC721_METADATA_ENUMERABLE_INVALID_INDEX]:"There is no asset at provided index.",[n.ProviderIssue.XCERT_CAPABILITY_NOT_SUPPORTED]:"Asset ledger does not have capability for this action.",[n.ProviderIssue.XCERT_TRANSFERS_DISABLED]:"Transfers on this asset ledger are currently disabled.",[n.ProviderIssue.XCERT_NOT_VALID_XCERT]:"Asset with this ID does not exist.",[n.ProviderIssue.XCERT_NOT_OWNER_OR_OPERATOR]:"Sender is neither asset owner nor operator.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_NOT_OWNER]:"You are not the owner of the order.",[n.ProviderIssue.SAFE_MATH_OVERFLOW]:"This action caused a math error: overflow.",[n.ProviderIssue.SAFE_MATH_SUBTRAHEND_GREATER_THEN_MINUEND]:"This action caused a math error: subtrahend is greater than minuend.",[n.ProviderIssue.SAFE_MATH_DIVISION_BY_ZERO]:"This action caused a math error: division by zero.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.XCERT_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_BALANCE]:"Sender does not have sufficient balance.",[n.ProviderIssue.DAPP_TOKEN_NOT_ENOUGH_ALLOWANCE]:"You do not have sufficient allowance.",[n.ProviderIssue.DAPP_TOKEN_NOT_WHITELISTED_ADDRESS]:"Tokens cannot be sent to this recipient. Recipients are limited.",[n.ProviderIssue.DAPP_TOKEN_NOT_MIGRATION_NOT_STARTED]:"Migration is not in progress.",[n.ProviderIssue.DAPP_TOKEN_MIGRATION_STARTED]:"Migration is in progress.",[n.ProviderIssue.DAPP_TOKEN_NOT_ABLE_TO_MIGRATE]:"Migration cannot be performed. Please notify token owner.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_PERFORMED]:"This order was already performed.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.DAPP_TOKEN_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.DAPP_TOKEN_CLAIM_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_TAKER_NOT_EQUAL_TO_SENDER]:"Sender is not allowed to execute this order.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_CANCELED]:"This order was canceled.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_DEPLOY_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ERC20_DEPLOY_GATEWAY_MAKER_NOT_EQUAL_TO_SENDER]:"Sender is not the creator of this order.",[n.ProviderIssue.ERC20_TRANSFER_PROXY_TRANSFER_FAILED]:"Transfer failed.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE_KIND]:"Provided signature kind is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_PROXY]:"Invalid proxy.",[n.ProviderIssue.ACTIONS_GATEWAY_SENDER_NOT_A_SIGNER]:"Sender is not one of the signers.",[n.ProviderIssue.ACTIONS_GATEWAY_CLAIM_EXPIRED]:"This order has expired.",[n.ProviderIssue.ACTIONS_GATEWAY_INVALID_SIGNATURE]:"Provided signature is invalid.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_CANCELED]:"This order was canceled.",[n.ProviderIssue.ACTIONS_GATEWAY_ORDER_ALREADY_PERFORMED]:"This order was already performed.",[n.ProviderIssue.ACTIONS_GATEWAY_SIGNERS_DOES_NOT_INCLUDE_SENDER]:"Sender is not one of the signers.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_CREATE_ASSET_ABILITY]:"Signer of CREATE_ASSET action does not have ALLOW_CREATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_UPDATE_ASSET_ABILITY]:"Signer of UPDATE_ASSET action does not have ALLOW_UPDATE_ASSET ability.",[n.ProviderIssue.SIGNER_DOES_NOT_HAVE_ALLOW_MANAGE_ABILITIES_ABILITY]:"Signer of SET_ASSET_LEDGER_ABILITY action does not have ALLOW_MANAGE_ABILITIES ability.",[n.ProviderIssue.SIGNER_IS_NOT_DESTROY_ASSET_OWNER]:"Signer of DESTROY_ASSET action is not the asset owner.",[n.ProviderIssue.ABILITABLE_NOT_AUTHORIZED]:"Sender does not have specified ability.",[n.ProviderIssue.ABILITABLE_INVALID_INPUT]:"Ability 0 is not a valid ability.",[n.ProviderIssue.OWNABLE_NOT_OWNER]:"Sender is not an owner.",[n.ProviderIssue.OWNABLE_ZERO_ADDRESS]:"Provided address cannot be zero address.",[n.ProviderIssue.CLAIMABLE_NOT_PENDING_OWNER]:"Sender cannot claim ownership."}},8330:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.MutationEvent=void 0,(r=t.MutationEvent||(t.MutationEvent={})).COMPLETE="complete",r.CONFIRM="confirm",r.ERROR="error"},677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ProviderError=t.ProviderEvent=void 0;const n=r(1414);var i;(i=t.ProviderEvent||(t.ProviderEvent={})).ACCOUNT_CHANGE="accountChanged",i.NETWORK_CHANGE="networkChanged";class o extends Error{constructor(e,t){super(),this.name="ProviderError",this.issue=e,this.original=t,this.message=n.default[e]||`GenericProvider error [issue: ${e}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}t.ProviderError=o},5079:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},6112:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(4508),t),i(r(677),t),i(r(1340),t),i(r(8330),t),i(r(8096),t),i(r(5079),t),i(r(2503),t)},5353:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(6496),t),i(r(509),t),i(r(9203),t),i(r(2890),t),i(r(4467),t),i(r(899),t),i(r(2938),t),i(r(7612),t)},6496:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0,t.fetchJson=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window)return window.fetch(e,t).then((e=>e.json()));if(0===e.lastIndexOf("http",0))return r(9002)(e,t).then((e=>e.json()));try{return Object(function(){var e=new Error("Cannot find module 'fs'");throw e.code="MODULE_NOT_FOUND",e}()).promises.readFile(e,"utf8").then((e=>JSON.parse(e)))}catch(e){return null}}))}},9203:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.keccak256=void 0;const n=r(6395);t.keccak256=function(e){return n.keccak256(e)}},509:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=void 0,t.sha=function(e,t){return n(this,void 0,void 0,(function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(t),n=yield window.crypto.subtle.digest(`SHA-${e}`,r);return Array.from(new Uint8Array(n)).map((e=>`00${e.toString(16)}`.slice(-2))).join("")}return r(1111).createHash(`sha${e}`).update(t).digest("hex")}))}},2890:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=void 0,t.toFloat=function(e){return parseFloat(`${e}`)||0}},4467:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=void 0,t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},899:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=void 0,t.toSeconds=function(e){return parseInt(""+parseFloat(`${e}`)/1e3)||0}},2938:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=void 0,t.toString=function(e){return null!=e?e.toString():null}},7612:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=void 0,t.toTuple=function e(t){if(!(t instanceof Object))return[];const r=[];let n=0;return Object.keys(t).forEach((i=>{if(t[i]instanceof Object)r[n]=e(t[i]);else if(t[i]instanceof Array){let o=0;const s=[];t[i].forEach((r=>{s[o]=e(t[i]),o++})),r[n]=s}else r[n]=t[i];n++})),r}},2895:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedger=void 0;const n=r(5291);class i extends n.AssetLedger{}t.AssetLedger=i},7745:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.AssetLedgerCapability=t.SuperAssetLedgerAbility=t.GeneralAssetLedgerAbility=void 0;var o=r(5291);Object.defineProperty(t,"GeneralAssetLedgerAbility",{enumerable:!0,get:function(){return o.GeneralAssetLedgerAbility}}),Object.defineProperty(t,"SuperAssetLedgerAbility",{enumerable:!0,get:function(){return o.SuperAssetLedgerAbility}}),Object.defineProperty(t,"AssetLedgerCapability",{enumerable:!0,get:function(){return o.AssetLedgerCapability}}),i(r(2895),t)},2792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Gateway=void 0;const n=r(8344);class i extends n.Gateway{}t.Gateway=i},2086:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.ProxyKind=t.AssetLedgerDeployOrder=t.FixedActionsOrder=t.SignedFixedActionsOrder=t.SignedDynamicActionsOrder=t.DynamicActionsOrder=t.ActionsOrderActionKind=void 0;var o=r(8344);Object.defineProperty(t,"ActionsOrderActionKind",{enumerable:!0,get:function(){return o.ActionsOrderActionKind}}),Object.defineProperty(t,"DynamicActionsOrder",{enumerable:!0,get:function(){return o.DynamicActionsOrder}}),Object.defineProperty(t,"SignedDynamicActionsOrder",{enumerable:!0,get:function(){return o.SignedDynamicActionsOrder}}),Object.defineProperty(t,"SignedFixedActionsOrder",{enumerable:!0,get:function(){return o.SignedFixedActionsOrder}}),Object.defineProperty(t,"FixedActionsOrder",{enumerable:!0,get:function(){return o.FixedActionsOrder}}),Object.defineProperty(t,"AssetLedgerDeployOrder",{enumerable:!0,get:function(){return o.AssetLedgerDeployOrder}}),Object.defineProperty(t,"ProxyKind",{enumerable:!0,get:function(){return o.ProxyKind}}),i(r(2792),t)},1277:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ValueLedger=void 0;const n=r(5508);class i extends n.ValueLedger{}t.ValueLedger=i},765:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(1277),t)},1111:e=>{"use strict";e.exports=void 0},2574:()=>{}},t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={id:n,loaded:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.loaded=!0,i.exports}r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(9230),r(7745),r(2086),r(765))})(); \ No newline at end of file From a1e46e7a8d7b5fd2ad7712f6f8d77c8c6282e540 Mon Sep 17 00:00:00 2001 From: Tadej Vengust Date: Fri, 17 Sep 2021 10:16:15 +0200 Subject: [PATCH 3/3] Update the way we calculate selector. --- .../src/contracts/utils/selector.sol | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol b/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol index c928531c6..e722595ba 100644 --- a/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol +++ b/packages/0xcert-ethereum-xcert-contracts/src/contracts/utils/selector.sol @@ -25,8 +25,7 @@ contract Selector pure returns (bytes4) { - ERC2477 i; - return (i.tokenURIIntegrity.selector ^ i.tokenURISchemaIntegrity.selector); + return type(ERC2477).interfaceId; } /** @@ -37,8 +36,7 @@ contract Selector pure returns (bytes4) { - Xcert i; - return (i.create.selector ^ i.setUri.selector); + return type(Xcert).interfaceId; } /** @@ -49,8 +47,7 @@ contract Selector pure returns (bytes4) { - XcertBurnable i; - return i.destroy.selector; + return type(XcertBurnable).interfaceId; } /** @@ -61,8 +58,7 @@ contract Selector pure returns (bytes4) { - XcertRevokable i; - return i.revoke.selector; + return type(XcertRevokable).interfaceId; } /** @@ -73,8 +69,7 @@ contract Selector pure returns (bytes4) { - XcertMutable i; - return i.updateTokenURIIntegrityDigest.selector; + return type(XcertMutable).interfaceId; } /** @@ -85,8 +80,7 @@ contract Selector pure returns (bytes4) { - XcertPausable i; - return i.setPause.selector; + return type(XcertPausable).interfaceId; } } \ No newline at end of file