diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8f98b8a08..dd51f2049 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -48,7 +48,7 @@ $ rush version --bump --override-bump minor $ rush publish --publish --include-all ``` -# 0xcet documentation +# 0xcert documentation We are using VuePress for building the documentation pages. Files are built locally from `.md` files located in `/docs` folder and generated into a `/docs/.vuepress/dist` folder. @@ -71,7 +71,7 @@ You can build and deploy the documentation to the server. $ npm run deploy ``` -# 0xcet conventions +# 0xcert conventions We are using VuePress for building the conventions pages. Files are built locally from `.md` files located in `/conventions` folder and generated into a `/convntions/.vuepress/dist` folder. diff --git a/README.md b/README.md index 0dcc8f595..f1503528c 100644 --- a/README.md +++ b/README.md @@ -10,36 +10,40 @@ To learn more about the 0xcert Framework, the Protocol, and the 0xcert news, ple * [The official 0xcert website](https://0xcert.org/), * [Our news blog](https://0xcert.org/news/). +## Supported platforms + +![Ethereum](./assets/ethereum.png) +![Wanchain](./assets/wanchain.png) + ## Packages +### Core | Package | Version | Description |-|-|- | 0xcert/cert | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fcert.svg)](https://badge.fury.io/js/%400xcert%2Fcert) | Module for certifying asset data objects. | 0xcert/conventions | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fconventions.svg)](https://badge.fury.io/js/%400xcert%2Fconventions) | Module with implementation of all confirmed conventions. + +### Ethereum +| Package | Version | Description +|-|-|- | 0xcert/ethereum-asset-ledger | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-asset-ledger.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-asset-ledger) | Asset ledger module for asset management on the Ethereum blockchain. -| 0xcert/ethereum-erc20-contracts | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-erc20-contracts.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-erc20-contracts) | Smart contract implementation of the ERC-20 standard on the Ethereum blockchain. -| 0xcert/ethereum-erc721-contracts | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-erc721-contracts.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-erc721-contracts) | Smart contract implementation of the ERC-721 standard on the Ethereum blockchain. -| 0xcert/ethereum-generic-provider | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-generic-provider.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-generic-provider) | Basic implementation of communication provider for the Ethereum blockchain. | 0xcert/ethereum-http-provider | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-http-provider.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-http-provider) | Implementation of HTTP communication provider for the Ethereum blockchain. | 0xcert/ethereum-metamask-provider | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-metamask-provider.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-metamask-provider) | Implementation of MetaMask communication provider for the Ethereum blockchain. | 0xcert/ethereum-order-gateway | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-order-gateway.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-order-gateway) | Order gateway module for executing atomic operations on the Ethereum blockchain. -| 0xcert/ethereum-order-gateway-contracts | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-order-gateway-contracts.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-order-gateway-contracts) | Smart contracts used by the order gateway on the Ethereum blockchain. -| 0xcert/ethereum-proxy-contracts | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-proxy-contracts.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-proxy-contracts) | Proxy smart contracts used by the order gateway when communicating with the Ethereum blockchain. -| 0xcert/ethereum-sandbox | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-sandbox.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-sandbox) | Test server for local running testing of modules on the Ethereum blockchain. -| 0xcert/ethereum-utils | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-utils.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-utils) | General Ethereum utility module with helper functions for the Ethereum blockchain. -| 0xcert/ethereum-utils-contracts | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-utils-contracts.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-utils-contracts) | General utility module with helper smart contracts. | 0xcert/ethereum-value-ledger | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-value-ledger.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-value-ledger) | Value ledger module for currency management on the Ethereum blockchain. -| 0xcert/ethereum-xcert-contracts | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fethereum-xcert-contracts.svg)](https://badge.fury.io/js/%400xcert%2Fethereum-xcert-contracts) | Smart contracts used by the Asset ledger on the Ethereum blockchain. -| 0xcert/merkle | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fmerkle.svg)](https://badge.fury.io/js/%400xcert%2Fmerkle) | Implementation of basic functions of binary Merkle tree. -| 0xcert/scaffold | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fscaffold.svg)](https://badge.fury.io/js/%400xcert%2Fscaffold) | Overarching module with types, enums, and interfaces for easier development of interoperable modules. -| 0xcert/utils | [![NPM Version](https://badge.fury.io/js/@0xcert%2Futils.svg)](https://badge.fury.io/js/%400xcert%2Futils) | General utility module with common helper functions. -| 0xcert/vue-example | - | VueJS plug-in example for NuxtJS. -| 0xcert/vue-plugin | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fvue-plugin.svg)](https://badge.fury.io/js/%400xcert%2Fvue-plugin) | Implementation of VueJS plug-in. -| 0xcert/webpack | - | Module for package building and minification. -## Supported platforms +### Wanchain +| Package | Version | Description +|-|-|- +| 0xcert/wanchain-asset-ledger | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fwanchain-asset-ledger.svg)](https://badge.fury.io/js/%400xcert%2Fwanchain-asset-ledger) | Asset ledger module for asset management on the Wanchain blockchain. +| 0xcert/wanchain-http-provider | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fwanchain-http-provider.svg)](https://badge.fury.io/js/%400xcert%2Fwanchain-http-provider) | Implementation of HTTP communication provider for the Wanchain blockchain. +| 0xcert/wanchain-order-gateway | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fwanchain-order-gateway.svg)](https://badge.fury.io/js/%400xcert%2Fwanchain-order-gateway) | Order gateway module for executing atomic operations on the Wanchain blockchain. +| 0xcert/wanchain-value-ledger | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fwanchain-value-ledger.svg)](https://badge.fury.io/js/%400xcert%2Fwanchain-value-ledger) | Value ledger module for currency management on the Wanchain blockchain. -![Ethereum](./assets/ethereum.png) +### Plugins +| Package | Version | Description +|-|-|- +| 0xcert/vue-plugin | [![NPM Version](https://badge.fury.io/js/@0xcert%2Fvue-plugin.svg)](https://badge.fury.io/js/%400xcert%2Fvue-plugin) | Implementation of VueJS plug-in. ## Contributing diff --git a/assets/wanchain.png b/assets/wanchain.png new file mode 100644 index 000000000..c02fc165e Binary files /dev/null and b/assets/wanchain.png differ diff --git a/common/config/rush/npm-shrinkwrap.json b/common/config/rush/npm-shrinkwrap.json index 822557289..0d9c68b15 100644 --- a/common/config/rush/npm-shrinkwrap.json +++ b/common/config/rush/npm-shrinkwrap.json @@ -849,9 +849,9 @@ "integrity": "sha512-shAmDyaQC4H92APFoIaVDHCx5bStIocgvbwQyxPRrbUY20V1EYTbSDchWbuwlMG3V17cprZhA6+78JfB+3DTPw==" }, "@nuxt/babel-preset-app": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.6.1.tgz", - "integrity": "sha512-cRHeg4oQSKTjgJph8od5frNVSGCAGfEFerDC5ZX0xqthGfeWE8a0pL00w5Y1R33zYDQlEkNk5u4y/Xfipz2JgA==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/babel-preset-app/-/babel-preset-app-2.6.2.tgz", + "integrity": "sha512-ygIZKu1MEuV+gGdKVPPV4hvSE18V6Dre6AtcvrKeWCjYYKQJTOCwH6bIUlQEPbzgLFBzZZS3wn1fG7qK3SbhAg==", "requires": { "@babel/core": "^7.4.3", "@babel/plugin-proposal-class-properties": "^7.4.0", @@ -865,19 +865,19 @@ } }, "@nuxt/builder": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/builder/-/builder-2.6.1.tgz", - "integrity": "sha512-NvoBx6+8p91fxYEQ7AUO1nEbDPYIVQ4LVlXXgiR9N3Jrl92AE6LtER6uMs1K2z9FdkMnEDbYaCnczU/0xYaJTg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/builder/-/builder-2.6.2.tgz", + "integrity": "sha512-+fi7Dw+RgOjkK6vftCT/nwFvGxCYfIzMt6ld7FOEnJ66had33e2DHozkY2msd709u5wDSin37ZwM5DgNl24phA==", "requires": { - "@nuxt/devalue": "^1.2.2", - "@nuxt/utils": "2.6.1", - "@nuxt/vue-app": "2.6.1", + "@nuxt/devalue": "^1.2.3", + "@nuxt/utils": "2.6.2", + "@nuxt/vue-app": "2.6.2", "chokidar": "^2.1.5", - "consola": "^2.5.8", + "consola": "^2.6.0", "fs-extra": "^7.0.1", "glob": "^7.1.3", "hash-sum": "^1.0.2", - "ignore": "^5.0.6", + "ignore": "^5.1.0", "lodash": "^4.17.11", "pify": "^4.0.1", "semver": "^6.0.0", @@ -886,9 +886,9 @@ }, "dependencies": { "ignore": { - "version": "5.0.6", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.0.6.tgz", - "integrity": "sha512-/+hp3kUf/Csa32ktIaj0OlRqQxrgs30n62M90UBpNd9k+ENEch5S+hmbW3DtcJGz3sYFTh4F3A6fQ0q7KWsp4w==" + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.1.tgz", + "integrity": "sha512-DWjnQIFLenVrwyRCKZT+7a7/U4Cqgar4WG8V++K3hw+lrW1hc/SIwdiGmtxKCVACmHULTuGeBbHJmbwW7/sAvA==" }, "pify": { "version": "4.0.1", @@ -903,15 +903,15 @@ } }, "@nuxt/cli": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/cli/-/cli-2.6.1.tgz", - "integrity": "sha512-Cy77LeVmXz9g7LJIU2pOVbKsKy6Alxl55gKLMqsrs8AmyqNa5Eu2aDuAP5uqoOUcrw46T6Szv0qW0yzcwW13Nw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/cli/-/cli-2.6.2.tgz", + "integrity": "sha512-YQruI3hlIjKg8bCaT/Odn0vD1bf2kvsb60SDHWrUnN4rKeCdFiCbLWrn+ZE/mHtVmM8uNRJSFsIcgcTH9cItzQ==", "requires": { - "@nuxt/config": "2.6.1", - "@nuxt/utils": "2.6.1", - "boxen": "^3.0.0", + "@nuxt/config": "2.6.2", + "@nuxt/utils": "2.6.2", + "boxen": "^3.1.0", "chalk": "^2.4.2", - "consola": "^2.5.8", + "consola": "^2.6.0", "esm": "3.2.20", "execa": "^1.0.0", "exit": "^0.1.2", @@ -946,26 +946,26 @@ } }, "@nuxt/config": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/config/-/config-2.6.1.tgz", - "integrity": "sha512-BIkT9ma6zQ1X/TY8F6hUWBEuJ6ie70VIF/5qjuIaTXEETNQEMSRIugO2mh6pTGCX8gEm2x6Yj91gL0uqF0pjQQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/config/-/config-2.6.2.tgz", + "integrity": "sha512-y9n+Dgei4Vhrb5h1530IYSnwqoyUefu4HG68lof8nNqs5TejjcJhcnnjh0df77wIqX20C256eXYATwo3Vn8rdQ==", "requires": { - "@nuxt/utils": "2.6.1", - "consola": "^2.5.8", + "@nuxt/utils": "2.6.2", + "consola": "^2.6.0", "std-env": "^2.2.1" } }, "@nuxt/core": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/core/-/core-2.6.1.tgz", - "integrity": "sha512-LaNQ6bpS5hdyrjgHzU3lAoo7extv+49PSPfNK+/+n0CPtAFf/VfH76kOJMiFLgaar2njOD6WWFj18yImkDy+Ag==", - "requires": { - "@nuxt/config": "2.6.1", - "@nuxt/devalue": "^1.2.2", - "@nuxt/server": "2.6.1", - "@nuxt/utils": "2.6.1", - "@nuxt/vue-renderer": "2.6.1", - "consola": "^2.5.8", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/core/-/core-2.6.2.tgz", + "integrity": "sha512-JWp/5vH6sG7Js5JSOC6AhdiYqyhBddzRKqEkD2k5a/EeLi/EdgXMwL9L6l66Vne/adaCLQ5LYUm/djqKVu5Cxg==", + "requires": { + "@nuxt/config": "2.6.2", + "@nuxt/devalue": "^1.2.3", + "@nuxt/server": "2.6.2", + "@nuxt/utils": "2.6.2", + "@nuxt/vue-renderer": "2.6.2", + "consola": "^2.6.0", "debug": "^4.1.1", "esm": "3.2.20", "fs-extra": "^7.0.1", @@ -984,9 +984,9 @@ } }, "@nuxt/devalue": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/@nuxt/devalue/-/devalue-1.2.2.tgz", - "integrity": "sha512-T3S20YKOG0bzhvFRuGWqXLjqnwTczvRns5BgzHKRosijWHjl6tOpWCIr+2PFC5YQ3gTE4c5ZOLG5wOEcMLvn1w==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@nuxt/devalue/-/devalue-1.2.3.tgz", + "integrity": "sha512-iA25xn409pguKhJwfNKQNCzWDZS44yhLcuVPpfy2CQ4xMqrJRpBxePTpkdCRxf7/m66M3rmCgkDZlvex4ygc6w==", "requires": { "consola": "^2.5.6" } @@ -1003,26 +1003,26 @@ } }, "@nuxt/generator": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/generator/-/generator-2.6.1.tgz", - "integrity": "sha512-F+SfHdUv/EBLcHOb8YTvVrtPbggdJ/4n28RWbML4O3kQqDATw9NT1rW5TznFFNCARa6IJqrKNFcE/zeYee4eBg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/generator/-/generator-2.6.2.tgz", + "integrity": "sha512-EEj/SR/Bz/FypDNkyhmL5BdhFSMSLc+Fon/GlVuwb3xWUnc1uKUWpc5EDbmioL1Nw/BC8Tai2LhbdHfKXjGfzA==", "requires": { - "@nuxt/utils": "2.6.1", + "@nuxt/utils": "2.6.2", "chalk": "^2.4.2", - "consola": "^2.5.8", + "consola": "^2.6.0", "fs-extra": "^7.0.1", "html-minifier": "^4.0.0" } }, "@nuxt/loading-screen": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/@nuxt/loading-screen/-/loading-screen-0.2.0.tgz", - "integrity": "sha512-QprkUsdOMqwQuw4OeQUX/Fj4LOyLSAAi0aa6mxxpITjfLScTp6Bx2Z+flG0cU19w0L2WSZtdqfQtjY6tYaTVuw==", + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@nuxt/loading-screen/-/loading-screen-0.3.0.tgz", + "integrity": "sha512-h0Z5g2MxJCXyeRmzx3Niwkv+/HRQEkKYpL54cN9cHYc4FUG/NBxeIIJgqbh1ih7y5cg0jdDboL0izZrbFsBtiA==", "requires": { "connect": "^3.6.6", "fs-extra": "^7.0.1", "serve-static": "^1.13.2", - "ws": "^6.2.0" + "ws": "^6.2.1" }, "dependencies": { "ws": { @@ -1046,17 +1046,17 @@ } }, "@nuxt/server": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.6.1.tgz", - "integrity": "sha512-jiCHS6TU0yZVm5TwCWQPi/nm7nVI4i4CRm2mTc+IP0Lesr6aOSi/oyaiFoDF2an163v3mIQU0JuDgnSX8zkuVw==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/server/-/server-2.6.2.tgz", + "integrity": "sha512-LLicBR2/Q0mgcB847L5p6k2gr+7e4JNW2cnvaS1Y1a5NJ5u6toN6HDtMim0RP3VZKTAqgY8S4j1KMrrDjajirA==", "requires": { - "@nuxt/config": "2.6.1", - "@nuxt/utils": "2.6.1", + "@nuxt/config": "2.6.2", + "@nuxt/utils": "2.6.2", "@nuxtjs/youch": "^4.2.3", "chalk": "^2.4.2", "compression": "^1.7.4", "connect": "^3.6.6", - "consola": "^2.5.8", + "consola": "^2.6.0", "etag": "^1.8.1", "fresh": "^0.5.2", "fs-extra": "^7.0.1", @@ -1084,11 +1084,11 @@ } }, "@nuxt/utils": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/utils/-/utils-2.6.1.tgz", - "integrity": "sha512-lCCAa7E1tRHvXMDd37GXfV92edc0VPKye2Z5/res6uZ1dWORhSnYMqeszmnKjpNiEjTOpMW6lNOjKncrjc4PeQ==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/utils/-/utils-2.6.2.tgz", + "integrity": "sha512-n5ZCLgdbdMB6/3mAZqu2nSiFHcQ/BwqP8xtYP/Bn6vl6WLWMIoVB/QmC6pywJtv1ABJhVMMdTeCKLV8hZ7iXEQ==", "requires": { - "consola": "^2.5.8", + "consola": "^2.6.0", "fs-extra": "^7.0.1", "hash-sum": "^1.0.2", "proper-lockfile": "^4.1.1", @@ -1097,28 +1097,28 @@ } }, "@nuxt/vue-app": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/vue-app/-/vue-app-2.6.1.tgz", - "integrity": "sha512-1X7WTMyTS6QTQFa8qn+tLPOMD5ZxGQP/sJsUFE9rHnwjIYG06SFnnWeJOxK6D+9P3F/bxm22JoR2CCFwrqc/tg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/vue-app/-/vue-app-2.6.2.tgz", + "integrity": "sha512-mz6MeabwijfZ/+2o/hZaknXYl209o9c7UDCDdqUF3ZD/WJ6dl5bbyAKpJuw2hunOCoQm4tSYdB17z41qLMfMpw==", "requires": { "node-fetch": "^2.3.0", "unfetch": "^4.1.0", "vue": "^2.6.10", "vue-meta": "^1.6.0", "vue-no-ssr": "^1.1.1", - "vue-router": "^3.0.2", + "vue-router": "^3.0.5", "vue-template-compiler": "^2.6.10", "vuex": "^3.1.0" } }, "@nuxt/vue-renderer": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/vue-renderer/-/vue-renderer-2.6.1.tgz", - "integrity": "sha512-ioCXah0tL5laRAHtwV5iQ2tlRE97Z/dW/byiaVEUBdkxKFMsSZw12SD3d2zM67Tx8e8/LpVCKUTigLzBkZr9Gg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/vue-renderer/-/vue-renderer-2.6.2.tgz", + "integrity": "sha512-SQCP2g8CAcOf0JLAkNBMmwjXgRBsL3K0IxiFQwFXb6X7OLsO9U643xGe0ZzHkW3Ud5KwMPc9NRG5QGpsFLzFVw==", "requires": { - "@nuxt/devalue": "^1.2.2", - "@nuxt/utils": "2.6.1", - "consola": "^2.5.8", + "@nuxt/devalue": "^1.2.3", + "@nuxt/utils": "2.6.2", + "consola": "^2.6.0", "fs-extra": "^7.0.1", "lru-cache": "^5.1.1", "vue": "^2.6.10", @@ -1142,23 +1142,23 @@ } }, "@nuxt/webpack": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/@nuxt/webpack/-/webpack-2.6.1.tgz", - "integrity": "sha512-hvY/wXqGzlIdYveDDMeWluFW9drpiU0PujFQoIdeFW6r03RHKPr3nUVD6Hhs7y4PoT3ob+DWbdm0T1EvA74AIg==", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/@nuxt/webpack/-/webpack-2.6.2.tgz", + "integrity": "sha512-+Ibt8MoKornD+uDZ+x9437kp1iHQLRBRvthZlxjuo1+lXY26Sb9Ugp53bP0MWYKjEOWEkNz47uaotNPxUzqLUQ==", "requires": { "@babel/core": "^7.4.3", - "@nuxt/babel-preset-app": "2.6.1", + "@nuxt/babel-preset-app": "2.6.2", "@nuxt/friendly-errors-webpack-plugin": "^2.4.0", - "@nuxt/utils": "2.6.1", + "@nuxt/utils": "2.6.2", "babel-loader": "^8.0.5", "cache-loader": "^2.0.1", - "caniuse-lite": "^1.0.30000957", + "caniuse-lite": "^1.0.30000959", "chalk": "^2.4.2", - "consola": "^2.5.8", + "consola": "^2.6.0", "css-loader": "^2.1.1", "cssnano": "^4.1.10", "eventsource-polyfill": "^0.9.6", - "extract-css-chunks-webpack-plugin": "^4.3.0", + "extract-css-chunks-webpack-plugin": "^4.3.1", "file-loader": "^3.0.1", "fs-extra": "^7.0.1", "glob": "^7.1.3", @@ -1181,8 +1181,8 @@ "time-fix-plugin": "^2.0.5", "url-loader": "^1.1.2", "vue-loader": "^15.7.0", - "webpack": "^4.29.6", - "webpack-bundle-analyzer": "^3.1.0", + "webpack": "^4.30.0", + "webpack-bundle-analyzer": "^3.3.2", "webpack-dev-middleware": "^3.6.2", "webpack-hot-middleware": "^2.24.3", "webpack-node-externals": "^1.7.2", @@ -1488,9 +1488,69 @@ "typescript": "^3.1.1" } }, + "@rush-temp/wanchain-asset-ledger": { + "version": "file:projects/wanchain-asset-ledger.tgz", + "integrity": "sha512-0RTTczUinlRPAB33qHDou11U3a4xT2vh8IMl4vEJXHV+HdJF/KSkkqQAAy5E6MEdoxbsND80R6DEfH9F9dLhcQ==", + "requires": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + } + }, + "@rush-temp/wanchain-http-provider": { + "version": "file:projects/wanchain-http-provider.tgz", + "integrity": "sha512-UkMyoNi6CyN7zTO4H130YcbaPMyKobXZCHyx3mQVhR73jl87V1eMeZIDlgxXzxM+Q9N+QYjTVvykZFcMldsCWw==", + "requires": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + } + }, + "@rush-temp/wanchain-order-gateway": { + "version": "file:projects/wanchain-order-gateway.tgz", + "integrity": "sha512-gBOyWdRBbpBeucxw3kAsxozzLvY9qt+3BPk2S99wts4uyKuBkDAoYzcKSNvAxP0etIUj942CDR9Z+FnMk56sbA==", + "requires": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + } + }, + "@rush-temp/wanchain-utils": { + "version": "file:projects/wanchain-utils.tgz", + "integrity": "sha512-HCBKoe+rC3pdoIRZ0t8WBZKOHaLDVdPfP8hDjQuvw5Tpe0X8rg8EIgEjm13V37vL5xtiQGfgXXk7nkM6DbLamw==", + "requires": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "ethers": "4.0.0-beta.1", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + } + }, + "@rush-temp/wanchain-value-ledger": { + "version": "file:projects/wanchain-value-ledger.tgz", + "integrity": "sha512-D2tPBaiQbqHDYd9/QQLDh/1vr3LOku+8Xs1sPS6XcbH3PA2+vZ67f6pEQ6pKXrjuimtoCSz1IlX0q1F6nF0hYg==", + "requires": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + } + }, "@rush-temp/webpack": { "version": "file:projects/webpack.tgz", - "integrity": "sha512-Gcq4Khat+FCPIvaCm/dRZxqnexQxxcqrV49Y+Dw7Ys8vWXzZNime53myzcmxzjiou3hDN5PxuhsxJoPvEqbndg==", + "integrity": "sha512-i+ySMyoENMzn64toTElqb++EEuCdLWXwfVJDDCJfMIdoZgDIfiUGNWBh4zLaO6MmxwfNegTwaFiZnE42LA5S5g==", "requires": { "webpack": "^4.25.0", "webpack-cli": "^3.1.2" @@ -1516,21 +1576,31 @@ "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" }, + "inquirer": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", + "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", + "requires": { + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", + "mute-stream": "0.0.7", + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.0.0", + "through": "^2.3.6" + } + }, "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==" }, - "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==", - "requires": { - "emoji-regex": "^7.0.1", - "is-fullwidth-code-point": "^2.0.0", - "strip-ansi": "^5.1.0" - } - }, "yargs": { "version": "13.2.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-13.2.1.tgz", @@ -1547,6 +1617,18 @@ "which-module": "^2.0.0", "y18n": "^4.0.0", "yargs-parser": "^13.0.0" + }, + "dependencies": { + "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==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + } } }, "yargs-parser": { @@ -1609,9 +1691,9 @@ } }, "@types/node": { - "version": "10.14.4", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.4.tgz", - "integrity": "sha512-DT25xX/YgyPKiHFOpNuANIQIVvYEwCWXgK2jYYwqgaMrYE6+tq+DtmMwlD3drl6DJbUwtlIDnn0d7tIn/EbXBg==" + "version": "10.14.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.14.5.tgz", + "integrity": "sha512-Ja7d4s0qyGFxjGeDq5S7Si25OFibSAHUi6i17UWnwNnpitADN7hah9q0Tl25gxuV5R1u2Bx+np6w4LHXfHyj/g==" }, "@types/q": { "version": "1.5.2", @@ -2159,9 +2241,9 @@ } }, "async-each": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.2.tgz", - "integrity": "sha512-6xrbvN0MOBKSJDdonmSSz2OwFSgxRaVtBDes26mj9KIGtDo+g9xosFRSC+i1gQh2oAN/tQ62AI/pGZGQjVOiRg==" + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==" }, "async-limiter": { "version": "1.0.0", @@ -2210,58 +2292,6 @@ "is-buffer": "^2.0.2" } }, - "babel-code-frame": { - "version": "6.26.0", - "resolved": "https://registry.npmjs.org/babel-code-frame/-/babel-code-frame-6.26.0.tgz", - "integrity": "sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=", - "requires": { - "chalk": "^1.1.3", - "esutils": "^2.0.2", - "js-tokens": "^3.0.2" - }, - "dependencies": { - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" - }, - "ansi-styles": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.2.1.tgz", - "integrity": "sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=" - }, - "chalk": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.3.tgz", - "integrity": "sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=", - "requires": { - "ansi-styles": "^2.2.1", - "escape-string-regexp": "^1.0.2", - "has-ansi": "^2.0.0", - "strip-ansi": "^3.0.0", - "supports-color": "^2.0.0" - } - }, - "js-tokens": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", - "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=" - }, - "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" - } - }, - "supports-color": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", - "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=" - } - } - }, "babel-loader": { "version": "8.0.5", "resolved": "https://registry.npmjs.org/babel-loader/-/babel-loader-8.0.5.tgz", @@ -2557,13 +2587,6 @@ "requires": { "js-sha3": "^0.6.1", "safe-buffer": "^5.1.1" - }, - "dependencies": { - "js-sha3": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", - "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" - } } }, "browserify-sign": { @@ -2589,13 +2612,13 @@ } }, "browserslist": { - "version": "4.5.4", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.4.tgz", - "integrity": "sha512-rAjx494LMjqKnMPhFkuLmLp8JWEX0o8ADTGeAbOqaF+XCvYLreZrG5uVjnPBlAQ8REZK4pzXGvp0bWgrFtKaag==", + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.5.5.tgz", + "integrity": "sha512-0QFO1r/2c792Ohkit5XI8Cm8pDtZxgNl2H6HU4mHrpYz7314pEYcsAVVatM0l/YmxPnEzh9VygXouj4gkFUTKA==", "requires": { - "caniuse-lite": "^1.0.30000955", - "electron-to-chromium": "^1.3.122", - "node-releases": "^1.1.13" + "caniuse-lite": "^1.0.30000960", + "electron-to-chromium": "^1.3.124", + "node-releases": "^1.1.14" } }, "buffer": { @@ -2777,9 +2800,9 @@ } }, "caniuse-lite": { - "version": "1.0.30000957", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000957.tgz", - "integrity": "sha512-8wxNrjAzyiHcLXN/iunskqQnJquQQ6VX8JHfW5kLgAPRSiSuKZiNfmIkP5j7jgyXqAQBSoXyJxfnbCFS0ThSiQ==" + "version": "1.0.30000962", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000962.tgz", + "integrity": "sha512-WXYsW38HK+6eaj5IZR16Rn91TGhU3OhbwjKZvJ4HN/XBIABLKfbij9Mnd3pM0VEwZSlltWjoWg3I8FQ0DGgNOA==" }, "caseless": { "version": "0.12.0", @@ -2971,9 +2994,9 @@ } }, "color": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/color/-/color-3.1.0.tgz", - "integrity": "sha512-CwyopLkuRYO5ei2EpzpIh6LqJMt6Mt+jZhO5VI5f/wJLZriXQE32/SSqzmrh+QB+AZT81Cj8yv+7zwToW8ahZg==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/color/-/color-3.1.1.tgz", + "integrity": "sha512-PvUltIXRjehRKPSy89VnDWFKY58xyhTLyxIg21vwQBI6qLwZNPmC8k3C1uytIgFKEpOIzN4y32iPm8231zFHIg==", "requires": { "color-convert": "^1.9.1", "color-string": "^1.5.2" @@ -3025,9 +3048,9 @@ "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==" }, "compressible": { "version": "2.0.16", @@ -3128,9 +3151,9 @@ } }, "consola": { - "version": "2.5.8", - "resolved": "https://registry.npmjs.org/consola/-/consola-2.5.8.tgz", - "integrity": "sha512-fYv1M0rNJw4h0CZUx8PX02Px7xQhA+vNHpV8DBCGMoozp2Io/vrSXhhEothaRnSt7VMR0rj2pt9KKLXa5amrCw==" + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/consola/-/consola-2.6.0.tgz", + "integrity": "sha512-jge0Ip1NVoOafxZq1zxG1sLYVBtKV45BF39VV6YKSWb45nyLOHY51YP0+cBQ2DyOTKhCjtF0XrRJkjTvX4wzgQ==" }, "console-browserify": { "version": "1.1.0", @@ -3907,19 +3930,22 @@ "integrity": "sha512-0xy4A/twfrRCnkhfk8ErDi5DqdAsAqeGxht4xkCUrsvhhbQNs7E+4jV0CN7+NKIY0aHE72+XvqtBIXzD31ZbXQ==" }, "electron-to-chromium": { - "version": "1.3.124", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.124.tgz", - "integrity": "sha512-glecGr/kFdfeXUHOHAWvGcXrxNU+1wSO/t5B23tT1dtlvYB26GY8aHzZSWD7HqhqC800Lr+w/hQul6C5AF542w==" + "version": "1.3.125", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.125.tgz", + "integrity": "sha512-XxowpqQxJ4nDwUXHtVtmEhRqBpm2OnjBomZmZtHD0d2Eo0244+Ojezhk3sD/MBSSe2nxCdGQFRXHIsf/LUTL9A==" }, "elliptic": { - "version": "6.3.3", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", - "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "version": "6.4.1", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", + "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "requires": { "bn.js": "^4.4.0", "brorand": "^1.0.1", "hash.js": "^1.0.0", - "inherits": "^2.0.1" + "hmac-drbg": "^1.0.0", + "inherits": "^2.0.1", + "minimalistic-assert": "^1.0.0", + "minimalistic-crypto-utils": "^1.0.0" } }, "emoji-regex": { @@ -4217,6 +4243,13 @@ "requires": { "idna-uts46-hx": "^2.3.1", "js-sha3": "^0.5.7" + }, + "dependencies": { + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + } } }, "eth-lib": { @@ -4231,22 +4264,6 @@ "servify": "^0.1.12", "ws": "^3.0.0", "xhr-request-promise": "^0.1.2" - }, - "dependencies": { - "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - } } }, "ethers": { @@ -4264,6 +4281,43 @@ "setimmediate": "1.0.4", "uuid": "2.0.1", "xmlhttprequest": "1.8.0" + }, + "dependencies": { + "elliptic": { + "version": "6.3.3", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.3.3.tgz", + "integrity": "sha1-VILZZG1UvLif19mU/J4ulWiHbj8=", + "requires": { + "bn.js": "^4.4.0", + "brorand": "^1.0.1", + "hash.js": "^1.0.0", + "inherits": "^2.0.1" + } + }, + "hash.js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", + "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "requires": { + "inherits": "^2.0.3", + "minimalistic-assert": "^1.0.0" + } + }, + "js-sha3": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", + "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + }, + "setimmediate": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", + "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + } } }, "ethjs-unit": { @@ -4538,9 +4592,9 @@ } }, "extract-css-chunks-webpack-plugin": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-4.3.0.tgz", - "integrity": "sha512-U2mCuqF9JKmyQydQQUy+tsCVCeuysgIZNZHd0eeTgIgq6gSqCnS9eaCpknyLVl3aRr8y2gkvRPzpuHS7AdvK0Q==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/extract-css-chunks-webpack-plugin/-/extract-css-chunks-webpack-plugin-4.3.2.tgz", + "integrity": "sha512-dTL4rwoMIwItq8KRhhgdHPcgFf7DwFRRcQBLj5F3k/WL2pSkYN//rS/dNUuRhbNgTMOV0HT60WjCVd9UGDaSOQ==", "requires": { "loader-utils": "^1.1.0", "lodash": "^4.17.11", @@ -4921,37 +4975,33 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" }, "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.8.tgz", + "integrity": "sha512-tPvHgPGB7m40CZ68xqFGkKuzN+RnpGmSV+hgeKxhRpbxdqKXUFJGC3yonBOLzQBcJyGpdZFDfCsdOC2KFsXzeA==", "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { "abbrev": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "bundled": true, "optional": true }, "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", + "bundled": true, "optional": true }, "aproba": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", + "bundled": true, "optional": true }, "are-we-there-yet": { "version": "1.1.5", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.5.tgz", - "integrity": "sha512-5hYdAkZlcG8tOLujVDTgCT+uPX0VnpAH28gWsLfzpXYm7wP6mp5Q/gYyR7YQ0cKVJcXJnl3j2kpBan13PtQf6w==", + "bundled": true, "optional": true, "requires": { "delegates": "^1.0.0", @@ -4960,14 +5010,12 @@ }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", + "bundled": true, "optional": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "optional": true, "requires": { "balanced-match": "^1.0.0", @@ -4976,65 +5024,55 @@ }, "chownr": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.1.tgz", - "integrity": "sha512-j38EvO5+LHX84jlo6h4UzmOwi0UgW61WRyPtJz4qaadK5eY3BTS5TY/S1Stc3Uk2lIM6TPevAlULiEJwie860g==", + "bundled": true, "optional": true }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", + "bundled": true, "optional": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", + "bundled": true, "optional": true }, "console-control-strings": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", + "bundled": true, "optional": true }, "core-util-is": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "bundled": true, "optional": true }, "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "version": "4.1.1", + "bundled": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-extend": { "version": "0.6.0", - "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", - "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "bundled": true, "optional": true }, "delegates": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", + "bundled": true, "optional": true }, "detect-libc": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", - "integrity": "sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=", + "bundled": true, "optional": true }, "fs-minipass": { "version": "1.2.5", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-1.2.5.tgz", - "integrity": "sha512-JhBl0skXjUPCFH7x6x61gQxrKyXsxB5gcgePLZCwfyCGGsTISMoIeObbrvVeP6Xmyaudw4TT43qV2Gz+iyd2oQ==", + "bundled": true, "optional": true, "requires": { "minipass": "^2.2.1" @@ -5042,14 +5080,12 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "bundled": true, "optional": true }, "gauge": { "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", + "bundled": true, "optional": true, "requires": { "aproba": "^1.0.3", @@ -5064,8 +5100,7 @@ }, "glob": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "bundled": true, "optional": true, "requires": { "fs.realpath": "^1.0.0", @@ -5078,14 +5113,12 @@ }, "has-unicode": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", + "bundled": true, "optional": true }, "iconv-lite": { "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "bundled": true, "optional": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -5093,8 +5126,7 @@ }, "ignore-walk": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", - "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "bundled": true, "optional": true, "requires": { "minimatch": "^3.0.4" @@ -5102,8 +5134,7 @@ }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "optional": true, "requires": { "once": "^1.3.0", @@ -5112,20 +5143,17 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "bundled": true, "optional": true }, "ini": { "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", + "bundled": true, "optional": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "optional": true, "requires": { "number-is-nan": "^1.0.0" @@ -5133,14 +5161,12 @@ }, "isarray": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "bundled": true, "optional": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "optional": true, "requires": { "brace-expansion": "^1.1.7" @@ -5148,14 +5174,12 @@ }, "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "bundled": true, "optional": true }, "minipass": { "version": "2.3.5", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.3.5.tgz", - "integrity": "sha512-Gi1W4k059gyRbyVUZQ4mEqLm0YIUiGYfvxhF6SIlk3ui1WVxMTGfGdQ2SInh3PDrRTVvPKgULkpJtT4RH10+VA==", + "bundled": true, "optional": true, "requires": { "safe-buffer": "^5.1.2", @@ -5164,8 +5188,7 @@ }, "minizlib": { "version": "1.2.1", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-1.2.1.tgz", - "integrity": "sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA==", + "bundled": true, "optional": true, "requires": { "minipass": "^2.2.1" @@ -5173,34 +5196,30 @@ }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "optional": true, "requires": { "minimist": "0.0.8" } }, "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "version": "2.1.1", + "bundled": true, "optional": true }, "needle": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/needle/-/needle-2.2.4.tgz", - "integrity": "sha512-HyoqEb4wr/rsoaIDfTH2aVL9nWtQqba2/HvMv+++m8u0dz808MaagKILxtfeSN7QU7nvbQ79zk3vYOJp9zsNEA==", + "version": "2.3.0", + "bundled": true, "optional": true, "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.10.3", - "resolved": "https://registry.npmjs.org/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz", - "integrity": "sha512-d1xFs+C/IPS8Id0qPTZ4bUT8wWryfR/OzzAFxweG+uLN85oPzyo2Iw6bVlLQ/JOdgNonXLCoRyqDzDWq4iw72A==", + "version": "0.12.0", + "bundled": true, "optional": true, "requires": { "detect-libc": "^1.0.2", @@ -5217,8 +5236,7 @@ }, "nopt": { "version": "4.0.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-4.0.1.tgz", - "integrity": "sha1-0NRoWv1UFRk8jHUFYC0NF81kR00=", + "bundled": true, "optional": true, "requires": { "abbrev": "1", @@ -5226,15 +5244,13 @@ } }, "npm-bundled": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/npm-bundled/-/npm-bundled-1.0.5.tgz", - "integrity": "sha512-m/e6jgWu8/v5niCUKQi9qQl8QdeEduFA96xHDDzFGqly0OOjI7c+60KM/2sppfnUU9JJagf+zs+yGhqSOFj71g==", + "version": "1.0.6", + "bundled": true, "optional": true }, "npm-packlist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/npm-packlist/-/npm-packlist-1.2.0.tgz", - "integrity": "sha512-7Mni4Z8Xkx0/oegoqlcao/JpPCPEMtUvsmB0q7mgvlMinykJLSRTYuFqoQLYgGY8biuxIeiHO+QNJKbCfljewQ==", + "version": "1.4.1", + "bundled": true, "optional": true, "requires": { "ignore-walk": "^3.0.1", @@ -5243,8 +5259,7 @@ }, "npmlog": { "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", + "bundled": true, "optional": true, "requires": { "are-we-there-yet": "~1.1.2", @@ -5255,20 +5270,17 @@ }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", + "bundled": true, "optional": true }, "object-assign": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "bundled": true, "optional": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "optional": true, "requires": { "wrappy": "1" @@ -5276,20 +5288,17 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=", + "bundled": true, "optional": true }, "os-tmpdir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "bundled": true, "optional": true }, "osenv": { "version": "0.1.5", - "resolved": "https://registry.npmjs.org/osenv/-/osenv-0.1.5.tgz", - "integrity": "sha512-0CWcCECdMVc2Rw3U5w9ZjqX6ga6ubk1xDVKxtBQPK7wis/0F2r9T6k4ydGYhecl7YUBxBVxhL5oisPsNxAPe2g==", + "bundled": true, "optional": true, "requires": { "os-homedir": "^1.0.0", @@ -5298,20 +5307,17 @@ }, "path-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "bundled": true, "optional": true }, "process-nextick-args": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.0.tgz", - "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==", + "bundled": true, "optional": true }, "rc": { "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "bundled": true, "optional": true, "requires": { "deep-extend": "^0.6.0", @@ -5322,16 +5328,14 @@ "dependencies": { "minimist": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "bundled": true, "optional": true } } }, "readable-stream": { "version": "2.3.6", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.6.tgz", - "integrity": "sha512-tQtKA9WIAhBF3+VLAseyMqZeBjW0AHJoxOtYqSUZNJxauErmLbVm2FW1y+J/YA9dUrAC39ITejlZWhVIwawkKw==", + "bundled": true, "optional": true, "requires": { "core-util-is": "~1.0.0", @@ -5345,8 +5349,7 @@ }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "bundled": true, "optional": true, "requires": { "glob": "^7.1.3" @@ -5354,44 +5357,37 @@ }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "bundled": true, "optional": true }, "safer-buffer": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "bundled": true, "optional": true }, "sax": { "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==", + "bundled": true, "optional": true }, "semver": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "version": "5.7.0", + "bundled": true, "optional": 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, "optional": 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, "optional": true }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "optional": true, "requires": { "code-point-at": "^1.0.0", @@ -5401,8 +5397,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "bundled": true, "optional": true, "requires": { "safe-buffer": "~5.1.0" @@ -5410,8 +5405,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "optional": true, "requires": { "ansi-regex": "^2.0.0" @@ -5419,14 +5413,12 @@ }, "strip-json-comments": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "bundled": true, "optional": true }, "tar": { "version": "4.4.8", - "resolved": "https://registry.npmjs.org/tar/-/tar-4.4.8.tgz", - "integrity": "sha512-LzHF64s5chPQQS0IYBn9IN5h3i98c12bo4NCO7e0sGM2llXQ3p2FGC5sdENN4cTW48O915Sh+x+EXx7XW96xYQ==", + "bundled": true, "optional": true, "requires": { "chownr": "^1.1.1", @@ -5440,14 +5432,12 @@ }, "util-deprecate": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=", + "bundled": true, "optional": true }, "wide-align": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "bundled": true, "optional": true, "requires": { "string-width": "^1.0.2 || 2" @@ -5455,14 +5445,12 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", + "bundled": true, "optional": true }, "yallist": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.0.3.tgz", - "integrity": "sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==", + "bundled": true, "optional": true } } @@ -7401,22 +7389,6 @@ "requires": { "bn.js": "^4.11.8", "ethereumjs-util": "^6.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.1.0", - "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", - "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } } }, "ethereumjs-block": { @@ -11104,22 +11076,6 @@ "requires": { "bn.js": "^4.11.8", "ethereumjs-util": "^6.0.0" - }, - "dependencies": { - "ethereumjs-util": { - "version": "6.1.0", - "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", - "ethjs-util": "0.1.6", - "keccak": "^1.0.2", - "rlp": "^2.0.0", - "safe-buffer": "^5.1.1", - "secp256k1": "^3.0.1" - } - } } }, "ethereumjs-block": { @@ -11539,18 +11495,18 @@ "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU=" }, "gzip-size": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.0.0.tgz", - "integrity": "sha512-5iI7omclyqrnWw4XbXAmGhPsABkSIDQonv2K0h61lybgofWa6iZyvrI3r2zsJH4P8Nb64fFVzlvfhs0g7BBxAA==", + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gzip-size/-/gzip-size-5.1.0.tgz", + "integrity": "sha512-wfSnvypBDRW94v5W3ckvvz/zFUNdJ81VgOP6tE4bPpRUcc0wGqU+y0eZjJEvKxwubJFix6P84sE8M51YWLT7rQ==", "requires": { "duplexer": "^0.1.1", - "pify": "^3.0.0" + "pify": "^4.0.1" }, "dependencies": { "pify": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==" } } }, @@ -11683,12 +11639,12 @@ "integrity": "sha1-M7QHd3VMZDJXPBIMw4CLvRDUfwQ=" }, "hash.js": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.3.tgz", - "integrity": "sha512-/UETyP0W22QILqS+6HowevwhEFJ3MBJnwTf75Qob9Wz9t0DPuisL8kW8YZMK62dHAKE1c1p+gY1TtOLY+USEHA==", + "version": "1.1.7", + "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.0" + "minimalistic-assert": "^1.0.1" } }, "he": { @@ -12016,9 +11972,9 @@ "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" }, "inquirer": { - "version": "6.2.2", - "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", - "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", + "version": "6.3.1", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.3.1.tgz", + "integrity": "sha512-MmL624rfkFt4TG9y/Jvmt8vdmOo836U7Y0Hxr2aFk3RelZEGX4Igk0KabWrcaaZaTv9uzglOqWh1Vly+FAWAXA==", "requires": { "ansi-escapes": "^3.2.0", "chalk": "^2.4.2", @@ -12031,7 +11987,7 @@ "run-async": "^2.2.0", "rxjs": "^6.4.0", "string-width": "^2.1.0", - "strip-ansi": "^5.0.0", + "strip-ansi": "^5.1.0", "through": "^2.3.6" } }, @@ -12059,9 +12015,9 @@ "integrity": "sha1-vd7XARQpCCjAoDnnLvJfWq7ENUo=" }, "ipaddr.js": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.8.0.tgz", - "integrity": "sha1-6qM9bd16zo9/b+DJygRA5wZzix4=" + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.0.tgz", + "integrity": "sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA==" }, "is-absolute-url": { "version": "2.1.0", @@ -12336,22 +12292,29 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=" }, "istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==" + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz", + "integrity": "sha512-LXTBICkMARVgo579kWDm8SqfB6nvSDKNqIOBEjmJRnL04JvoMHCYGWaMddQnseJYtkEuEvO/sIcOxPLk9gERug==" }, "istanbul-lib-instrument": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", - "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.2.0.tgz", + "integrity": "sha512-06IM3xShbNW4NgZv5AP4QH0oHqf1/ivFo8eFys0ZjPXHGldHJQWb3riYOKXqmOqfxXBfxu4B+g/iuhOPZH0RJg==", "requires": { "@babel/generator": "^7.0.0", "@babel/parser": "^7.0.0", "@babel/template": "^7.0.0", "@babel/traverse": "^7.0.0", "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.3", - "semver": "^5.5.0" + "istanbul-lib-coverage": "^2.0.4", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.0.0.tgz", + "integrity": "sha512-0UewU+9rFapKFnlbirLi3byoOuhrSsli/z/ihNnvM24vgF+8sNBiI1LZPBSH9wJKUwaUbw+s3hToDLCXkrghrQ==" + } } }, "isurl": { @@ -12369,9 +12332,9 @@ "integrity": "sha512-X2BB11YZtrRqY4EnQcLX5Rh373zbK4alC1FW7D7MBhL2gtcC17cTnr6DmfHZeS0s2rTHjUTMMHfG7gO8SSdw+g==" }, "js-sha3": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.5.7.tgz", - "integrity": "sha1-DU/9gALVMzqrr0oj7tL2N0yfKOc=" + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.6.1.tgz", + "integrity": "sha1-W4n3enR3Z5h39YxKB1JAk0sflcA=" }, "js-tokens": { "version": "4.0.0", @@ -12828,16 +12791,16 @@ "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ==" }, "mime-db": { - "version": "1.38.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.38.0.tgz", - "integrity": "sha512-bqVioMFFzc2awcdJZIzR3HjZFX20QhilVS7hytkKrv7xFAn8bM1gzc/FOX2awLISvWe0PV8ptFKcon+wZ5qYkg==" + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==" }, "mime-types": { - "version": "2.1.22", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.22.tgz", - "integrity": "sha512-aGl6TZGnhm/li6F7yx82bJiBZwgiEa4Hf6CNr8YO+r5UHr53tSTYZb102zyU50DOWWKeOv0uQLRL0/9EiKWCog==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "requires": { - "mime-db": "~1.38.0" + "mime-db": "1.40.0" } }, "mimic-fn": { @@ -12941,9 +12904,9 @@ } }, "mock-fs": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.8.0.tgz", - "integrity": "sha512-Gwj4KnJOW15YeTJKO5frFd/WDO5Mc0zxXqL9oHx3+e9rBqW8EVARqQHSaIXznUdljrD6pvbNGW2ZGXKPEfYJfw==" + "version": "4.9.0", + "resolved": "https://registry.npmjs.org/mock-fs/-/mock-fs-4.9.0.tgz", + "integrity": "sha512-aUj0qIniTNxzGqAC61Bvro7YD37tIBnMw3wpClucUVgNBS7r6YQn/M4wuoH7SGteKz4SvC1OBeDsfpG0MYC+1Q==" }, "mout": { "version": "0.11.1", @@ -13117,9 +13080,9 @@ "integrity": "sha512-UdS4swXs85fCGWWf6t6DMGgpN/vnlKeSGEQ7hJcrs7PBFoxoKLmibc3QRb7fwiYsjdL7PX8iI/TMSlZ90dgHhQ==" }, "node-releases": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.13.tgz", - "integrity": "sha512-fKZGviSXR6YvVPyc011NHuJDSD8gFQvLPmc2d2V3BS4gr52ycyQ1Xzs7a8B+Ax3Ni/W+5h1h4SqmzeoA8WZRmA==", + "version": "1.1.16", + "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.16.tgz", + "integrity": "sha512-BOMWCW9CaT4sffMa5S9Mj4vYObvVShyo6JoM9WzzQOKVyNUn1+OVMUaQT3fo2tJKCMwHjqaDW/Pf3/JsYmPD2g==", "requires": { "semver": "^5.3.0" } @@ -13182,17 +13145,17 @@ } }, "nuxt": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/nuxt/-/nuxt-2.6.1.tgz", - "integrity": "sha512-YS1XFerFZAM2C9wTh9zxbKaMrNZDFLWk2WiK9MaBvSMoT24+SXpnRLH550/etwTUVJTp7orjiKGeMLN5d6UwHQ==", - "requires": { - "@nuxt/builder": "2.6.1", - "@nuxt/cli": "2.6.1", - "@nuxt/core": "2.6.1", - "@nuxt/generator": "2.6.1", - "@nuxt/loading-screen": "^0.2.0", + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/nuxt/-/nuxt-2.6.2.tgz", + "integrity": "sha512-yeucSriOfS2le62OiHVkErzV1b1ZXMmy4Uqqmx/I9r3yKEMHloXFqFfTuD2FKum9a7TdyIfnt/uDI0wxeEqbxQ==", + "requires": { + "@nuxt/builder": "2.6.2", + "@nuxt/cli": "2.6.2", + "@nuxt/core": "2.6.2", + "@nuxt/generator": "2.6.2", + "@nuxt/loading-screen": "^0.3.0", "@nuxt/opencollective": "^0.2.2", - "@nuxt/webpack": "2.6.1" + "@nuxt/webpack": "2.6.2" } }, "nyc": { @@ -13228,44 +13191,37 @@ "dependencies": { "ansi-regex": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", - "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=" + "bundled": true }, "append-transform": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", + "bundled": true, "requires": { "default-require-extensions": "^2.0.0" } }, "archy": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/archy/-/archy-1.0.0.tgz", - "integrity": "sha1-+cjBN1fMHde8N5rHeyxipcKGjEA=" + "bundled": true }, "arrify": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" + "bundled": true }, "async": { "version": "2.6.2", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.2.tgz", - "integrity": "sha512-H1qVYh1MYhEEFLsP97cVKqCGo7KfCyTt6uEWqsTBr9SO84oK9Uwbyd/yCW+6rKJLHksBNUVWZDAjfS+Ccx0Bbg==", + "bundled": true, "requires": { "lodash": "^4.17.11" } }, "balanced-match": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=" + "bundled": true }, "brace-expansion": { "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "bundled": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -13273,8 +13229,7 @@ }, "caching-transform": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-3.0.1.tgz", - "integrity": "sha512-Y1KTLNwSPd4ljsDrFOtyXVmm7Gnk42yQitNq43AhE+cwUR/e4T+rmOHs1IPtzBg8066GBJfTOj1rQYFSWSsH2g==", + "bundled": true, "requires": { "hasha": "^3.0.0", "make-dir": "^1.3.0", @@ -13284,13 +13239,11 @@ }, "camelcase": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==" + "bundled": true }, "cliui": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-4.1.0.tgz", - "integrity": "sha512-4FG+RSG9DL7uEwRUZXZn3SS34DiDPfzP0VOiEwtUWlE+AR2EIg+hSyvrIgUUfhdgR/UkAeW2QHgeP+hWrXs7jQ==", + "bundled": true, "requires": { "string-width": "^2.1.1", "strip-ansi": "^4.0.0", @@ -13299,37 +13252,31 @@ }, "code-point-at": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=" + "bundled": true }, "commander": { "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", + "bundled": true, "optional": true }, "commondir": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", - "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" + "bundled": true }, "concat-map": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=" + "bundled": true }, "convert-source-map": { "version": "1.6.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", - "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "bundled": true, "requires": { "safe-buffer": "~5.1.1" } }, "cross-spawn": { "version": "4.0.2", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-4.0.2.tgz", - "integrity": "sha1-e5JHYhwjrf3ThWAEqCPL45dCTUE=", + "bundled": true, "requires": { "lru-cache": "^4.0.1", "which": "^1.2.9" @@ -13337,50 +13284,43 @@ }, "debug": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "bundled": true, "requires": { "ms": "^2.1.1" } }, "decamelize": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "bundled": true }, "default-require-extensions": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", + "bundled": true, "requires": { "strip-bom": "^3.0.0" } }, "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" } }, "error-ex": { "version": "1.3.2", - "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "bundled": true, "requires": { "is-arrayish": "^0.2.1" } }, "es6-error": { "version": "4.1.1", - "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==" + "bundled": true }, "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", @@ -13393,8 +13333,7 @@ "dependencies": { "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", @@ -13407,8 +13346,7 @@ }, "find-cache-dir": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz", - "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", + "bundled": true, "requires": { "commondir": "^1.0.1", "make-dir": "^1.0.0", @@ -13417,16 +13355,14 @@ }, "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" } }, "foreground-child": { "version": "1.5.6", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-1.5.6.tgz", - "integrity": "sha1-T9ca0t/elnibmApcCilZN8svXOk=", + "bundled": true, "requires": { "cross-spawn": "^4", "signal-exit": "^3.0.0" @@ -13434,26 +13370,22 @@ }, "fs.realpath": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=" + "bundled": true }, "get-caller-file": { "version": "1.0.3", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-1.0.3.tgz", - "integrity": "sha512-3t6rVToeoZfYSGd8YoLFR2DJkiQrIiUrGcjvFX2mDw3bn6k2OtwHN0TNCLbBO+w8qTvimhDkv+LSscbJY1vE6w==" + "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" } }, "glob": { "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "bundled": true, "requires": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -13465,13 +13397,11 @@ }, "graceful-fs": { "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==" + "bundled": true }, "handlebars": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.0.tgz", - "integrity": "sha512-l2jRuU1NAWK6AW5qqcTATWQJvNPEwkM7NEKSiv/gqOsoSQbVoWyqVEY5GS+XPQ88zLNmqASRpzfdm8d79hJS+w==", + "bundled": true, "requires": { "async": "^2.5.0", "optimist": "^0.6.1", @@ -13481,38 +13411,32 @@ "dependencies": { "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 } } }, "has-flag": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + "bundled": true }, "hasha": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/hasha/-/hasha-3.0.0.tgz", - "integrity": "sha1-UqMvq4Vp1BymmmH/GiFPjrfIvTk=", + "bundled": true, "requires": { "is-stream": "^1.0.1" } }, "hosted-git-info": { "version": "2.7.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", - "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==" + "bundled": true }, "imurmurhash": { "version": "0.1.4", - "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", - "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + "bundled": true }, "inflight": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "bundled": true, "requires": { "once": "^1.3.0", "wrappy": "1" @@ -13520,51 +13444,42 @@ }, "inherits": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=" + "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-arrayish": { "version": "0.2.1", - "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", - "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" + "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-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 }, "istanbul-lib-coverage": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==" + "bundled": true }, "istanbul-lib-hook": { "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz", - "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==", + "bundled": true, "requires": { "append-transform": "^1.0.0" } }, "istanbul-lib-report": { "version": "2.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz", - "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==", + "bundled": true, "requires": { "istanbul-lib-coverage": "^2.0.3", "make-dir": "^1.3.0", @@ -13573,8 +13488,7 @@ "dependencies": { "supports-color": { "version": "6.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-6.1.0.tgz", - "integrity": "sha512-qe1jfm1Mg7Nq/NSh6XE24gPXROEVsWHxC1LIx//XNlD9iw7YZQGjZNjYN7xGaEG6iKdA8EtNFW6R0gjnVXp+wQ==", + "bundled": true, "requires": { "has-flag": "^3.0.0" } @@ -13583,8 +13497,7 @@ }, "istanbul-lib-source-maps": { "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", - "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", + "bundled": true, "requires": { "debug": "^4.1.1", "istanbul-lib-coverage": "^2.0.3", @@ -13595,36 +13508,31 @@ "dependencies": { "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 } } }, "istanbul-reports": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.1.tgz", - "integrity": "sha512-FzNahnidyEPBCI0HcufJoSEoKykesRlFcSzQqjH9x0+LC8tnnE/p/90PBLu8iZTxr8yYZNyTtiAujUqyN+CIxw==", + "bundled": true, "requires": { "handlebars": "^4.1.0" } }, "json-parse-better-errors": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==" + "bundled": true }, "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" } }, "load-json-file": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", - "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "bundled": true, "requires": { "graceful-fs": "^4.1.2", "parse-json": "^4.0.0", @@ -13634,8 +13542,7 @@ }, "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" @@ -13643,18 +13550,15 @@ }, "lodash": { "version": "4.17.11", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", - "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + "bundled": true }, "lodash.flattendeep": { "version": "4.4.0", - "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", - "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=" + "bundled": true }, "lru-cache": { "version": "4.1.5", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", - "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "bundled": true, "requires": { "pseudomap": "^1.0.2", "yallist": "^2.1.2" @@ -13662,24 +13566,21 @@ }, "make-dir": { "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "bundled": true, "requires": { "pify": "^3.0.0" } }, "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" } }, "mem": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", - "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "bundled": true, "requires": { "map-age-cleaner": "^0.1.1", "mimic-fn": "^1.0.0", @@ -13688,66 +13589,56 @@ }, "merge-source-map": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/merge-source-map/-/merge-source-map-1.1.0.tgz", - "integrity": "sha512-Qkcp7P2ygktpMPh2mCQZaf3jhN6D3Z/qVZHSdWvQ+2Ef5HgRAPBO57A77+ENm0CPx2+1Ce/MYKi3ymqdfuqibw==", + "bundled": true, "requires": { "source-map": "^0.6.1" }, "dependencies": { "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 } } }, "mimic-fn": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==" + "bundled": true }, "minimatch": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "bundled": true, "requires": { "brace-expansion": "^1.1.7" } }, "minimist": { "version": "0.0.10", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.10.tgz", - "integrity": "sha1-3j+YVD2/lggr5IrRoMfNqDYwHc8=" + "bundled": true }, "mkdirp": { "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "bundled": true, "requires": { "minimist": "0.0.8" }, "dependencies": { "minimist": { "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=" + "bundled": true } } }, "ms": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", - "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==" + "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 }, "normalize-package-data": { "version": "2.5.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "bundled": true, "requires": { "hosted-git-info": "^2.1.4", "resolve": "^1.10.0", @@ -13757,29 +13648,25 @@ }, "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" } }, "number-is-nan": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" + "bundled": true }, "once": { "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "bundled": true, "requires": { "wrappy": "1" } }, "optimist": { "version": "0.6.1", - "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.6.1.tgz", - "integrity": "sha1-2j6nRob6IaGaERwybpDrFaAZZoY=", + "bundled": true, "requires": { "minimist": "~0.0.1", "wordwrap": "~0.0.2" @@ -13787,13 +13674,11 @@ }, "os-homedir": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-1.0.2.tgz", - "integrity": "sha1-/7xJiDNuDoM94MFox+8VISGqf7M=" + "bundled": true }, "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", @@ -13802,44 +13687,37 @@ }, "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.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==" + "bundled": true }, "p-limit": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "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.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" + "bundled": true }, "package-hash": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-3.0.0.tgz", - "integrity": "sha512-lOtmukMDVvtkL84rJHI7dpTYq+0rli8N2wlnqUcBuDWCfVhRUfOmnR9SsoHFMLpACvEV60dX7rd0rFaYDZI+FA==", + "bundled": true, "requires": { "graceful-fs": "^4.1.15", "hasha": "^3.0.0", @@ -13849,8 +13727,7 @@ }, "parse-json": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "bundled": true, "requires": { "error-ex": "^1.3.1", "json-parse-better-errors": "^1.0.1" @@ -13858,54 +13735,45 @@ }, "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-is-absolute": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" + "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 }, "path-parse": { "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==" + "bundled": true }, "path-type": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "bundled": true, "requires": { "pify": "^3.0.0" } }, "pify": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", - "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=" + "bundled": true }, "pkg-dir": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-3.0.0.tgz", - "integrity": "sha512-/E57AYkoeQ25qkxMj5PBOVgF8Kiu/h7cYS30Z5+R7WaiCCBfLq58ZI/dSeaEKb9WVJV5n/03QwrN3IeWIFllvw==", + "bundled": true, "requires": { "find-up": "^3.0.0" } }, "pseudomap": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", - "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=" + "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" @@ -13913,8 +13781,7 @@ }, "read-pkg": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", - "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "bundled": true, "requires": { "load-json-file": "^4.0.0", "normalize-package-data": "^2.3.2", @@ -13923,8 +13790,7 @@ }, "read-pkg-up": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-4.0.0.tgz", - "integrity": "sha512-6etQSH7nJGsK0RbG/2TeDzZFa8shjQ1um+SwQQ5cwKy0dhSXdOncEhb1CPpvQG4h7FyOV6EB6YlV0yJvZQNAkA==", + "bundled": true, "requires": { "find-up": "^3.0.0", "read-pkg": "^3.0.0" @@ -13932,80 +13798,67 @@ }, "release-zalgo": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", - "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "bundled": true, "requires": { "es6-error": "^4.0.1" } }, "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": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" + "bundled": true }, "resolve": { "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", + "bundled": true, "requires": { "path-parse": "^1.0.6" } }, "resolve-from": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==" + "bundled": true }, "rimraf": { "version": "2.6.3", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", + "bundled": true, "requires": { "glob": "^7.1.3" } }, "safe-buffer": { "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "bundled": true }, "semver": { "version": "5.6.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", - "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==" + "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 }, "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 }, "spawn-wrap": { "version": "1.4.2", - "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-1.4.2.tgz", - "integrity": "sha512-vMwR3OmmDhnxCVxM8M+xO/FtIp6Ju/mNaDfCMMW7FDcLRTPFWUswec4LXJHTJE2hwTI9O0YBfygu4DalFl7Ylg==", + "bundled": true, "requires": { "foreground-child": "^1.5.6", "mkdirp": "^0.5.0", @@ -14017,8 +13870,7 @@ }, "spdx-correct": { "version": "3.1.0", - "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", - "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "bundled": true, "requires": { "spdx-expression-parse": "^3.0.0", "spdx-license-ids": "^3.0.0" @@ -14026,13 +13878,11 @@ }, "spdx-exceptions": { "version": "2.2.0", - "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", - "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==" + "bundled": true }, "spdx-expression-parse": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", - "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "bundled": true, "requires": { "spdx-exceptions": "^2.1.0", "spdx-license-ids": "^3.0.0" @@ -14040,13 +13890,11 @@ }, "spdx-license-ids": { "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==" + "bundled": true }, "string-width": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", - "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "bundled": true, "requires": { "is-fullwidth-code-point": "^2.0.0", "strip-ansi": "^4.0.0" @@ -14054,26 +13902,22 @@ }, "strip-ansi": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "bundled": true, "requires": { "ansi-regex": "^3.0.0" } }, "strip-bom": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=" + "bundled": true }, "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 }, "test-exclude": { "version": "5.1.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.1.0.tgz", - "integrity": "sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==", + "bundled": true, "requires": { "arrify": "^1.0.1", "minimatch": "^3.0.4", @@ -14083,8 +13927,7 @@ }, "uglify-js": { "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "bundled": true, "optional": true, "requires": { "commander": "~2.17.1", @@ -14093,21 +13936,18 @@ "dependencies": { "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, "optional": true } } }, "uuid": { "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" + "bundled": true }, "validate-npm-package-license": { "version": "3.0.4", - "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "bundled": true, "requires": { "spdx-correct": "^3.0.0", "spdx-expression-parse": "^3.0.0" @@ -14115,26 +13955,22 @@ }, "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 }, "wordwrap": { "version": "0.0.3", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", - "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc=" + "bundled": true }, "wrap-ansi": { "version": "2.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", - "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", + "bundled": true, "requires": { "string-width": "^1.0.1", "strip-ansi": "^3.0.1" @@ -14142,21 +13978,18 @@ "dependencies": { "ansi-regex": { "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=" + "bundled": true }, "is-fullwidth-code-point": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", + "bundled": true, "requires": { "number-is-nan": "^1.0.0" } }, "string-width": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", + "bundled": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -14165,8 +13998,7 @@ }, "strip-ansi": { "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", + "bundled": true, "requires": { "ansi-regex": "^2.0.0" } @@ -14175,13 +14007,11 @@ }, "wrappy": { "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "bundled": true }, "write-file-atomic": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.2.tgz", - "integrity": "sha512-s0b6vB3xIVRLWywa6X9TOMA7k9zio0TMOsl9ZnDkliA/cfJlpHXAscj0gbHVJiTdIuAYpIyqS5GW91fqm6gG5g==", + "bundled": true, "requires": { "graceful-fs": "^4.1.11", "imurmurhash": "^0.1.4", @@ -14190,18 +14020,15 @@ }, "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 }, "yallist": { "version": "2.1.2", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", - "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=" + "bundled": true }, "yargs": { "version": "12.0.5", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-12.0.5.tgz", - "integrity": "sha512-Lhz8TLaYnxq/2ObqHDql8dX8CJi97oHxrjUcYtzKbbykPtVW9WB+poxI+NM2UIzsMgNCZTIf0AQwsjK5yMAqZw==", + "bundled": true, "requires": { "cliui": "^4.0.0", "decamelize": "^1.2.0", @@ -14219,8 +14046,7 @@ }, "yargs-parser": { "version": "11.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-11.1.1.tgz", - "integrity": "sha512-C6kB/WJDiaxONLJQnF8ccx9SEeoTTLek8RVbaOIsrAUS8VrBEXfmeSnCZxygc+XC2sNMBIwOOnfcxiynjHsVSQ==", + "bundled": true, "requires": { "camelcase": "^5.0.0", "decamelize": "^1.2.0" @@ -14520,9 +14346,9 @@ "integrity": "sha1-bVuTSkVpk7I9N/QKOC1vFmao5cY=" }, "parseurl": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.2.tgz", - "integrity": "sha1-/CidTtiZMRlGDBViUyYs3I3mW/M=" + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" }, "pascalcase": { "version": "0.1.1", @@ -15471,9 +15297,9 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=" }, "prettier": { - "version": "1.16.4", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.16.4.tgz", - "integrity": "sha512-ZzWuos7TI5CKUeQAtFd6Zhm2s6EpAD/ZLApIhsF9pRvRtM1RFo61dM/4MSRUA0SuLugA/zgrZD8m0BaY46Og7g==", + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.17.0.tgz", + "integrity": "sha512-sXe5lSt2WQlCbydGETgfm1YBShgOX4HxQkFPvbxkcwgDvGDeqVau8h+12+lmSVlP3rHPz0oavfddSZg/q+Szjw==", "optional": true }, "pretty-bytes": { @@ -15536,12 +15362,12 @@ } }, "proxy-addr": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.4.tgz", - "integrity": "sha512-5erio2h9jp5CHGwcybmxmVqHmnCBZeewlfJ0pex+UW7Qny7OOZXTtH56TGNyBizkgiOwhJtMKrVzDTeKcySZwA==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.5.tgz", + "integrity": "sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ==", "requires": { "forwarded": "~0.1.2", - "ipaddr.js": "1.8.0" + "ipaddr.js": "1.9.0" } }, "prr": { @@ -15887,13 +15713,6 @@ "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - } } }, "require-directory": { @@ -16009,9 +15828,9 @@ } }, "rxjs": { - "version": "6.4.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", - "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", + "version": "6.5.1", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.5.1.tgz", + "integrity": "sha512-y0j31WJc83wPu31vS1VlAFW5JGrnGC+j+TtGAa1fRQphy48+fDYiDmX8tjGloToEsMkxnouOg/1IzXGKkJnZMg==", "requires": { "tslib": "^1.9.0" } @@ -16143,9 +15962,9 @@ } }, "serialize-javascript": { - "version": "1.6.1", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.6.1.tgz", - "integrity": "sha512-A5MOagrPFga4YaKQSWHryl7AXvbQkEqpw4NNYMTNYUNV51bA8ABHgYFpqKx+YFFrw59xMV1qGH1R4AgoNIVgCw==" + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-1.7.0.tgz", + "integrity": "sha512-ke8UG8ulpFOxO8f8gRYabHQe/ZntKlcig2Mp+8+URDP1D8vJZ0KUt7LYo07q25Z/+JVSgpr/cui9PIp5H6/+nA==" }, "serve-placeholder": { "version": "1.2.1", @@ -16210,9 +16029,9 @@ } }, "setimmediate": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.4.tgz", - "integrity": "sha1-IOgd5iLUoCWIzgyNqJc8vPHTE48=" + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", + "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" }, "setprototypeof": { "version": "1.1.0", @@ -16668,9 +16487,9 @@ } }, "source-map-support": { - "version": "0.5.11", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.11.tgz", - "integrity": "sha512-//sajEx/fGL3iw6fltKMdPvy8kL3kJ2O3iuYlRoT3k9Kb4BjOoZ+BZzaNHeuaruSt+Kf3Zk9tnfAQg9/AJqUVQ==", + "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==", "requires": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" @@ -16964,9 +16783,9 @@ "integrity": "sha1-WPcc7jvVGbWdSyqEO2x95krAR2Q=" }, "svgo": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.1.tgz", - "integrity": "sha512-Y1+LyT4/y1ms4/0yxPMSlvx6dIbgklE9w8CIOnfeoFGB74MEkq8inSfEr6NhocTaFbyYp0a1dvNgRKGRmEBlzA==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/svgo/-/svgo-1.2.2.tgz", + "integrity": "sha512-rAfulcwp2D9jjdGu+0CuqlrAUin6bBWrpoqXWwKDZZZJfXcUXQSxLJOFJCQCSA0x0pP2U0TxSlJu2ROq5Bq6qA==", "requires": { "chalk": "^2.4.1", "coa": "^2.0.2", @@ -16975,7 +16794,7 @@ "css-tree": "1.0.0-alpha.28", "css-url-regex": "^1.1.0", "csso": "^3.5.1", - "js-yaml": "^3.13.0", + "js-yaml": "^3.13.1", "mkdirp": "~0.5.1", "object.values": "^1.1.0", "sax": "~1.2.4", @@ -17020,11 +16839,6 @@ "requires": { "graceful-fs": "^4.1.6" } - }, - "setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" } } }, @@ -17052,9 +16866,9 @@ } }, "tapable": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.1.tgz", - "integrity": "sha512-9I2ydhj8Z9veORCw5PRm4u9uebCn0mcCa6scWoNcbZ6dAtoo2618u9UUzxgmsCOreJpqDDuv61LvwofW7hLcBA==" + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/tapable/-/tapable-1.1.3.tgz", + "integrity": "sha512-4WK/bYZmj8xLr+HUCODHGF1ZFzsYffasLUgEiMBY4fgtltdO6B4WJtlSbPaDTLpYTcGVwM2qLnFTICEcNxs3kA==" }, "tar": { "version": "2.2.1", @@ -17372,11 +17186,11 @@ "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" }, "tslint": { - "version": "5.15.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.15.0.tgz", - "integrity": "sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", + "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", @@ -17426,9 +17240,9 @@ } }, "type-fest": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.0.tgz", - "integrity": "sha512-fg3sfdDdJDtdHLUpeGsf/fLyG1aapk6zgFiYG5+MDUPybGrJemH4SLk5tP7hGRe8ntxjg0q5LYW53b6YpJIQ9Q==" + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==" }, "type-is": { "version": "1.6.16", @@ -17453,9 +17267,9 @@ } }, "typescript": { - "version": "3.4.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.2.tgz", - "integrity": "sha512-Og2Vn6Mk7JAuWA1hQdDQN/Ekm/SchX80VzLhjKN9ETYrIepBFAd8PkOdOTK2nKt0FCkmMZKBJvQ1dV1gIxPu/A==" + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.4.tgz", + "integrity": "sha512-xt5RsIRCEaf6+j9AyOBgvVuAec0i92rgCaS3S+UVf5Z/vF2Hvtsw08wtUTJqp4djwznoAgjSxeCcU4r+CcDBJA==" }, "ua-parser-js": { "version": "0.7.19", @@ -17463,19 +17277,14 @@ "integrity": "sha512-T3PVJ6uz8i0HzPxOF9SWzWAlfN/DavlpQqepn22xgve/5QecC+XMCAtmUNnY7C9StehaV6exjUCI801lOI7QlQ==" }, "uglify-js": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.3.tgz", - "integrity": "sha512-rIQPT2UMDnk4jRX+w4WO84/pebU2jiLsjgIyrCktYgSvx28enOE3iYQMr+BD1rHiitWnDmpu0cY/LfIEpKcjcw==", + "version": "3.5.6", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.6.tgz", + "integrity": "sha512-YDKRX8F0Y+Jr7LhoVk0n4G7ltR3Y7qFAj+DtVBthlOgCcIj1hyMigCfousVfn9HKmvJ+qiFlLDwaHx44/e5ZKw==", "requires": { - "commander": "~2.19.0", + "commander": "~2.20.0", "source-map": "~0.6.1" }, "dependencies": { - "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==" - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -17757,9 +17566,9 @@ "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", - "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" }, "v8-compile-cache": { "version": "2.0.2", @@ -17833,9 +17642,9 @@ "integrity": "sha512-ZMjqRpWabMPqPc7gIrG0Nw6vRf1+itwf0Itft7LbMXs2g3Zs/NFmevjZGN1x7K3Q95GmIjWbQZTVerxiBxI+0g==" }, "vue-router": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.2.tgz", - "integrity": "sha512-opKtsxjp9eOcFWdp6xLQPLmRGgfM932Tl56U9chYTnoWqKxQ8M20N7AkdEbM5beUh6wICoFGYugAX9vQjyJLFg==" + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/vue-router/-/vue-router-3.0.6.tgz", + "integrity": "sha512-Ox0ciFLswtSGRTHYhGvx2L44sVbTPNS+uD2kRISuo8B39Y79rOo0Kw0hzupTmiVtftQYCZl87mwldhh2L9Aquw==" }, "vue-server-renderer": { "version": "2.6.10", @@ -18067,20 +17876,6 @@ "web3-utils": "1.0.0-beta.37" }, "dependencies": { - "elliptic": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.4.1.tgz", - "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", - "requires": { - "bn.js": "^4.4.0", - "brorand": "^1.0.1", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.0", - "inherits": "^2.0.1", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.0" - } - }, "eth-lib": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/eth-lib/-/eth-lib-0.2.7.tgz", @@ -18090,6 +17885,11 @@ "elliptic": "^6.4.0", "xhr-request-promise": "^0.1.2" } + }, + "uuid": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-2.0.1.tgz", + "integrity": "sha1-wqMN7bPlNdcsz4LjQ5QaULqFM6w=" } } }, @@ -18223,9 +18023,9 @@ } }, "webpack": { - "version": "4.29.6", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.29.6.tgz", - "integrity": "sha512-MwBwpiE1BQpMDkbnUUaW6K8RFZjljJHArC6tWQJoFm0oQtfoSebtg4Y7/QHnJ/SddtjYLHaKGX64CFjG5rehJw==", + "version": "4.30.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-4.30.0.tgz", + "integrity": "sha512-4hgvO2YbAFUhyTdlR4FNyt2+YaYBYHavyzjCMbZzgglo02rlKi/pcsEzwCuCpsn1ryzIl1cq/u8ArIKu8JBYMg==", "requires": { "@webassemblyjs/ast": "1.8.5", "@webassemblyjs/helper-module-context": "1.8.5", @@ -18266,9 +18066,9 @@ } }, "webpack-bundle-analyzer": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.2.0.tgz", - "integrity": "sha512-F6bwrg5TBb9HsHZCltH1L5F091ELQ+/i67MEH7jWkYRvVp53eONNneGaIXSdOQUiXUyd3RnkITWRfWvSVQGnZQ==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/webpack-bundle-analyzer/-/webpack-bundle-analyzer-3.3.2.tgz", + "integrity": "sha512-7qvJLPKB4rRWZGjVp5U1KEjwutbDHSKboAl0IfafnrdXMrgC0tOtZbQD6Rw0u4cmpgRN4O02Fc0t8eAT+FgGzA==", "requires": { "acorn": "^6.0.7", "acorn-walk": "^6.1.1", @@ -18296,9 +18096,9 @@ } }, "webpack-cli": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.0.tgz", - "integrity": "sha512-t1M7G4z5FhHKJ92WRKwZ1rtvi7rHc0NZoZRbSkol0YKl4HvcC8+DsmGDmK7MmZxHSAetHagiOsjOB6MmzC2TUw==", + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/webpack-cli/-/webpack-cli-3.3.1.tgz", + "integrity": "sha512-c2inFU7SM0IttEgF7fK6AaUsbBnORRzminvbyRKS+NlbQHVZdCtzKBlavRL5359bFsywXGRAItA5di/IruC8mg==", "requires": { "chalk": "^2.4.1", "cross-spawn": "^6.0.5", @@ -18376,13 +18176,6 @@ "requires": { "ansi-colors": "^3.0.0", "uuid": "^3.3.2" - }, - "dependencies": { - "uuid": { - "version": "3.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", - "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==" - } } }, "webpack-node-externals": { @@ -18407,36 +18200,54 @@ } }, "webpackbar": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-3.1.5.tgz", - "integrity": "sha512-ayCxwj0m3lw8TMkbBBRl3XNiCIHqXYaQus8sNL+jX0lsp4LrYO9OmijsPeuu91cd/oUgK66c0AKQovPtJ1qDsA==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/webpackbar/-/webpackbar-3.2.0.tgz", + "integrity": "sha512-PC4o+1c8gWWileUfwabe0gqptlXUDJd5E0zbpr2xHP1VSOVlZVPBZ8j6NCR8zM5zbKdxPhctHXahgpNK1qFDPw==", "requires": { - "ansi-escapes": "^3.1.0", + "ansi-escapes": "^4.1.0", "chalk": "^2.4.1", - "consola": "^2.3.0", - "figures": "^2.0.0", + "consola": "^2.6.0", + "figures": "^3.0.0", "pretty-time": "^1.1.0", "std-env": "^2.2.1", "text-table": "^0.2.0", - "wrap-ansi": "^4.0.0" + "wrap-ansi": "^5.1.0" }, "dependencies": { - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "ansi-escapes": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.1.0.tgz", + "integrity": "sha512-2VY/iCUZTDLD/qxptS3Zn3c6k2MeIbYqjRXqM8T5oC7N2mMjh3xIU3oYru6cHGbldFa9h5i8N0fP65UaUqrMWA==", "requires": { - "ansi-regex": "^3.0.0" + "type-fest": "^0.3.0" + } + }, + "figures": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.0.0.tgz", + "integrity": "sha512-HKri+WoWoUgr83pehn/SIgLOMZ9nAWC6dcGj26RY2R4F50u4+RTUz0RCrUlOV3nKRAICW1UGzyb+kcX2qK1S/g==", + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "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==", + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" } }, "wrap-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-4.0.0.tgz", - "integrity": "sha512-uMTsj9rDb0/7kk1PbcbCcwvHUxp60fGDB/NNXpVa0Q+ic/e7y5+BwTxKfQ33VYgDppSwi/FBzpetYzo8s6tfbg==", + "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==", "requires": { "ansi-styles": "^3.2.0", - "string-width": "^2.1.1", - "strip-ansi": "^4.0.0" + "string-width": "^3.0.0", + "strip-ansi": "^5.0.0" } } } diff --git a/conventions/.vuepress/package-lock.json b/conventions/.vuepress/package-lock.json index 7cd18f079..2cdee903a 100644 --- a/conventions/.vuepress/package-lock.json +++ b/conventions/.vuepress/package-lock.json @@ -41,7 +41,7 @@ "jsesc": "^2.5.1", "lodash": "^4.17.11", "source-map": "^0.5.0", - "trim-right": "^1.0.1" + "trim-right": "^1.2.0" } }, "@babel/helper-annotate-as-pure": { @@ -746,7 +746,7 @@ "resolved": "https://registry.npmjs.org/@mrmlnc/readdir-enhanced/-/readdir-enhanced-2.2.1.tgz", "integrity": "sha512-bPHp6Ji8b41szTOcaP63VlnbbO5Ny6dwAATtY6JTjh5N2OLrb5Qk/Th5cRkRQhkWCt+EJsYrNB0MiL+Gpn6e3g==", "requires": { - "call-me-maybe": "^1.0.1", + "call-me-maybe": "^1.2.0", "glob-to-regexp": "^0.3.0" } }, @@ -889,8 +889,8 @@ "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", "requires": { "cssesc": "^2.0.0", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" + "indexes-of": "^1.2.0", + "uniq": "^1.2.0" } }, "source-map": { @@ -939,10 +939,10 @@ "lru-cache": "^5.1.1", "mini-css-extract-plugin": "0.4.4", "optimize-css-assets-webpack-plugin": "^4.0.0", - "portfinder": "^1.0.13", + "portfinder": "^1.2.03", "postcss-loader": "^2.1.5", "toml": "^2.3.3", - "url-loader": "^1.0.1", + "url-loader": "^1.2.0", "vue": "^2.5.16", "vue-loader": "^15.2.4", "vue-router": "^3.0.2", @@ -1281,8 +1281,8 @@ } }, "ajv-errors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/ajv-errors/-/ajv-errors-1.2.0.tgz", "integrity": "sha512-DCRfO/4nQ+89p/RK43i8Ezd41EqdGIU4ld7nGF8OQ14oc/we5rEntLCUa7+jrn3nn83BosfwZA0wb4pon2o8iQ==" }, "ajv-keywords": { @@ -1305,9 +1305,9 @@ "inherits": "^2.0.1", "isarray": "^2.0.1", "load-script": "^1.0.0", - "object-keys": "^1.0.11", + "object-keys": "^1.2.01", "querystring-es3": "^0.2.1", - "reduce": "^1.0.1", + "reduce": "^1.2.0", "semver": "^5.1.0", "tunnel-agent": "^0.6.0" }, @@ -1343,8 +1343,8 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=" }, "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.2.0.tgz", "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=" }, "ansi-colors": { @@ -1389,7 +1389,7 @@ "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", "requires": { - "remove-trailing-separator": "^1.0.1" + "remove-trailing-separator": "^1.2.0" } } } @@ -1400,8 +1400,8 @@ "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==" }, "argparse": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", + "version": "1.2.00", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.2.00.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "requires": { "sprintf-js": "~1.0.2" @@ -1432,7 +1432,7 @@ "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "requires": { - "array-uniq": "^1.0.1" + "array-uniq": "^1.2.0" } }, "array-uniq": { @@ -1446,8 +1446,8 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=" }, "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.2.0.tgz", "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=" }, "asn1": { @@ -1507,8 +1507,8 @@ "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=" }, "async-each": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.2.0.tgz", "integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=" }, "asynckit": { @@ -1680,7 +1680,7 @@ "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", "requires": { - "cache-base": "^1.0.1", + "cache-base": "^1.2.0", "class-utils": "^0.3.5", "component-emitter": "^1.2.1", "define-property": "^1.0.0", @@ -1801,7 +1801,7 @@ "integrity": "sha1-jokKGD2O6aI5OzhExpGkK897yfU=", "requires": { "array-flatten": "^2.1.0", - "deep-equal": "^1.0.1", + "deep-equal": "^1.2.0", "dns-equal": "^1.0.0", "dns-txt": "^2.0.2", "multicast-dns": "^6.0.1", @@ -1868,8 +1868,8 @@ } }, "browserify-cipher": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/browserify-cipher/-/browserify-cipher-1.2.0.tgz", "integrity": "sha512-sPhkz0ARKbf4rRQt2hTpAHqn47X3llLkUGn+xEJzLjwY8LRs2p0v7ljvI5EyoRO/mexrNunNECisZs+gw2zz1w==", "requires": { "browserify-aes": "^1.0.4", @@ -1882,7 +1882,7 @@ "resolved": "https://registry.npmjs.org/browserify-des/-/browserify-des-1.0.2.tgz", "integrity": "sha512-BioO1xf3hFwz4kc6iBhI3ieDFompMhrMlnDFC4/0/vd5MokpuAc3R+LYbwTA9A5Yc9pq9UYPqffKpW2ObuwX5A==", "requires": { - "cipher-base": "^1.0.1", + "cipher-base": "^1.2.0", "des.js": "^1.0.0", "inherits": "^2.0.1", "safe-buffer": "^5.1.2" @@ -1975,14 +1975,14 @@ "integrity": "sha512-Dph0MzuH+rTQzGPNT9fAnrPmMmjKfST6trxJeK7NQuHRaVw24VzPRWTmg9MpcwOVQZO0E1FBICUlFeNaKPIfHA==", "requires": { "bluebird": "^3.5.1", - "chownr": "^1.0.1", + "chownr": "^1.2.0", "glob": "^7.1.2", "graceful-fs": "^4.1.11", "lru-cache": "^4.1.1", "mississippi": "^2.0.0", "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", + "move-concurrently": "^1.2.0", + "promise-inflight": "^1.2.0", "rimraf": "^2.6.2", "ssri": "^5.2.4", "unique-filename": "^1.1.0", @@ -2006,8 +2006,8 @@ } }, "cache-base": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.2.0.tgz", "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", "requires": { "collection-visit": "^1.0.0", @@ -2033,8 +2033,8 @@ } }, "call-me-maybe": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.2.0.tgz", "integrity": "sha1-JtII6onje1y95gJQoV8DHBak1ms=" }, "camel-case": { @@ -2104,7 +2104,7 @@ "integrity": "sha512-IwXUx0FXc5ibYmPC2XeEj5mpXoV66sR+t3jqu2NS2GYwCktt3KF1/Qqjws/NkegajBA4RbZ5+DDwlOiJsxDHEg==", "requires": { "anymatch": "^2.0.0", - "async-each": "^1.0.1", + "async-each": "^1.2.0", "braces": "^2.3.2", "fsevents": "^1.2.7", "glob-parent": "^3.1.0", @@ -2321,7 +2321,7 @@ "requires": { "color": "^0.11.0", "css-color-names": "0.0.4", - "has": "^1.0.1" + "has": "^1.2.0" } }, "colors": { @@ -2349,8 +2349,8 @@ "dev": true }, "commondir": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/commondir/-/commondir-1.2.0.tgz", "integrity": "sha1-3dgA2gxmEnOTzKWVDqloo6rxJTs=" }, "component-emitter": { @@ -2375,7 +2375,7 @@ "bytes": "3.0.0", "compressible": "~2.0.14", "debug": "2.6.9", - "on-headers": "~1.0.1", + "on-headers": "~1.2.0", "safe-buffer": "5.1.2", "vary": "~1.1.2" }, @@ -2514,7 +2514,7 @@ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-1.0.0.tgz", "integrity": "sha1-kojj6ePMN0hxfTnq3hfPcfww7m8=", "requires": { - "commondir": "^1.0.1", + "commondir": "^1.2.0", "make-dir": "^1.0.0", "pkg-dir": "^2.0.0" } @@ -2532,7 +2532,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-7.1.1.tgz", "integrity": "sha1-+yzP+UAfhgCUXfral0QMypcrhoA=", "requires": { - "array-union": "^1.0.1", + "array-union": "^1.2.0", "dir-glob": "^2.0.0", "glob": "^7.1.2", "ignore": "^3.3.5", @@ -2615,7 +2615,7 @@ "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", + "cipher-base": "^1.2.0", "inherits": "^2.0.1", "md5.js": "^1.3.4", "ripemd160": "^2.0.1", @@ -2754,7 +2754,7 @@ "boolbase": "~1.0.0", "css-what": "2.1", "domutils": "1.5.1", - "nth-check": "~1.0.1" + "nth-check": "~1.2.0" } }, "css-selector-tokenizer": { @@ -2815,7 +2815,7 @@ "autoprefixer": "^6.3.1", "decamelize": "^1.1.2", "defined": "^1.0.0", - "has": "^1.0.1", + "has": "^1.2.0", "object-assign": "^4.0.1", "postcss": "^5.0.14", "postcss-calc": "^5.2.0", @@ -2831,7 +2831,7 @@ "postcss-merge-longhand": "^2.0.1", "postcss-merge-rules": "^2.0.3", "postcss-minify-font-values": "^1.0.2", - "postcss-minify-gradients": "^1.0.1", + "postcss-minify-gradients": "^1.2.0", "postcss-minify-params": "^1.0.4", "postcss-minify-selectors": "^2.0.4", "postcss-normalize-charset": "^1.1.0", @@ -2969,8 +2969,8 @@ "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=" }, "deep-equal": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.2.0.tgz", "integrity": "sha1-9dJgKStmDghO/0zbyfCK0yR0SLU=" }, "deepmerge": { @@ -2992,7 +2992,7 @@ "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "requires": { - "object-keys": "^1.0.12" + "object-keys": "^1.2.02" } }, "define-property": { @@ -3055,7 +3055,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", "requires": { - "array-union": "^1.0.1", + "array-union": "^1.2.0", "glob": "^7.0.3", "object-assign": "^4.0.1", "pify": "^2.0.0", @@ -3126,7 +3126,7 @@ "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-2.0.0.tgz", "integrity": "sha512-37qirFDz8cA5fimp9feo43fSuRo2gHwaIn6dXL8Ber1dGwUosDrGZeCCXq57WnIqE4aQ+u3eQZzsk1yOzhdwag==", "requires": { - "arrify": "^1.0.1", + "arrify": "^1.2.0", "path-type": "^3.0.0" } }, @@ -3161,7 +3161,7 @@ "autocomplete.js": "0.33.0", "hogan.js": "^3.0.2", "request": "^2.87.0", - "stack-utils": "^1.0.1", + "stack-utils": "^1.2.0", "to-factory": "^1.0.0", "zepto": "^1.2.0" } @@ -3251,7 +3251,7 @@ "integrity": "sha512-BsXLz5sqX8OHcsh7CqBMztyXARmGQ3LWPtGjJi6DiJHq5C/qvi9P3OqgswKSDftbu8+IoI/QDTAm2fFnQ9SZSQ==", "requires": { "bn.js": "^4.4.0", - "brorand": "^1.0.1", + "brorand": "^1.2.0", "hash.js": "^1.0.0", "hmac-drbg": "^1.0.0", "inherits": "^2.0.1", @@ -3306,7 +3306,7 @@ "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.7.tgz", "integrity": "sha512-MfrRBDWzIWifgq6tJj60gkAwtLNb6sQPlcFrSOflcP1aFmmruKQ2wRnze/8V6kgyz7H3FF8Npzv78mZ7XLLflg==", "requires": { - "prr": "~1.0.1" + "prr": "~1.2.0" } }, "error-ex": { @@ -3327,7 +3327,7 @@ "has": "^1.0.3", "is-callable": "^1.1.4", "is-regex": "^1.0.4", - "object-keys": "^1.0.12" + "object-keys": "^1.2.02" } }, "es-to-primitive": { @@ -3336,7 +3336,7 @@ "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", "requires": { "is-callable": "^1.1.4", - "is-date-object": "^1.0.1", + "is-date-object": "^1.2.0", "is-symbol": "^1.0.2" } }, @@ -3497,7 +3497,7 @@ "etag": "~1.8.1", "finalhandler": "1.1.1", "fresh": "0.5.2", - "merge-descriptors": "1.0.1", + "merge-descriptors": "1.2.0", "methods": "~1.1.2", "on-finished": "~2.3.0", "parseurl": "~1.3.2", @@ -3511,7 +3511,7 @@ "setprototypeof": "1.1.0", "statuses": "~1.4.0", "type-is": "~1.6.16", - "utils-merge": "1.0.1", + "utils-merge": "1.2.0", "vary": "~1.1.2" }, "dependencies": { @@ -3546,12 +3546,12 @@ "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", "requires": { "assign-symbols": "^1.0.0", - "is-extendable": "^1.0.1" + "is-extendable": "^1.2.0" }, "dependencies": { "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.2.0.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { "is-plain-object": "^2.0.4" @@ -3736,7 +3736,7 @@ "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-2.0.0.tgz", "integrity": "sha512-LDUY6V1Xs5eFskUVYtIwatojt6+9xC9Chnlk/jYOOvn3FAFfSaWddxahDGyNHh0b2dMXa6YW2m0tk8TdVaXHlA==", "requires": { - "commondir": "^1.0.1", + "commondir": "^1.2.0", "make-dir": "^1.0.0", "pkg-dir": "^3.0.0" } @@ -3844,8 +3844,8 @@ } }, "fs-write-stream-atomic": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.10.tgz", + "version": "1.2.00", + "resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.2.00.tgz", "integrity": "sha1-tH31NJPvkR33VzHnCp3tAYnbQMk=", "requires": { "graceful-fs": "^4.1.2", @@ -3978,7 +3978,7 @@ "has-unicode": "^2.0.0", "object-assign": "^4.1.0", "signal-exit": "^3.0.0", - "string-width": "^1.0.1", + "string-width": "^1.2.0", "strip-ansi": "^3.0.1", "wide-align": "^1.1.0" } @@ -4139,7 +4139,7 @@ "optional": true, "requires": { "ignore-walk": "^3.0.1", - "npm-bundled": "^1.0.1" + "npm-bundled": "^1.2.0" } }, "npmlog": { @@ -4154,7 +4154,7 @@ } }, "number-is-nan": { - "version": "1.0.1", + "version": "1.2.0", "bundled": true, "optional": true }, @@ -4191,7 +4191,7 @@ } }, "path-is-absolute": { - "version": "1.0.1", + "version": "1.2.0", "bundled": true, "optional": true }, @@ -4229,7 +4229,7 @@ "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "util-deprecate": "~1.2.0" } }, "rimraf": { @@ -4451,7 +4451,7 @@ "resolved": "https://registry.npmjs.org/globby/-/globby-8.0.2.tgz", "integrity": "sha512-yTzMmKygLp8RUpG1Ymu2VXPSJQZjNAZPD4ywgYEaG7e4tBJeUQBO8OpXrf1RCNcEs5alsoJYPAMiIHP0cmeC7w==", "requires": { - "array-union": "^1.0.1", + "array-union": "^1.2.0", "dir-glob": "2.0.0", "fast-glob": "^2.0.2", "glob": "^7.1.2", @@ -4579,7 +4579,7 @@ "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", "requires": { "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" + "minimalistic-assert": "^1.2.0" } }, "he": { @@ -4588,13 +4588,13 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.2.0.tgz", "integrity": "sha1-0nRXAQJabHdabFRXk+1QL8DGSaE=", "requires": { "hash.js": "^1.0.3", "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" + "minimalistic-crypto-utils": "^1.2.0" } }, "hoek": { @@ -4609,7 +4609,7 @@ "integrity": "sha1-TNnhq9QpQUbnZ55B14mHMrAse/0=", "requires": { "mkdirp": "0.3.0", - "nopt": "1.0.10" + "nopt": "1.2.00" }, "dependencies": { "mkdirp": { @@ -4679,7 +4679,7 @@ "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "util-deprecate": "^1.2.0" } } } @@ -4813,8 +4813,8 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" }, "indexes-of": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.2.0.tgz", "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" }, "indexof": { @@ -4909,8 +4909,8 @@ "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=" }, "is-binary-path": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.2.0.tgz", "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", "requires": { "binary-extensions": "^1.0.0" @@ -4953,8 +4953,8 @@ } }, "is-date-object": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.2.0.tgz", "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=" }, "is-descriptor": { @@ -5021,8 +5021,8 @@ } }, "is-obj": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.2.0.tgz", "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", "dev": true }, @@ -5032,19 +5032,19 @@ "integrity": "sha1-0iXsIxMuie3Tj9p2dHLmLmXxEG0=" }, "is-path-in-cwd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-1.2.0.tgz", "integrity": "sha512-FjV1RTW48E7CWM7eE/J2NJvAEEVektecDBVBE5Hh3nM1Jd0kvhHtX68Pr3xsDf857xt3Y4AkwVULK1Vku62aaQ==", "requires": { "is-path-inside": "^1.0.0" } }, "is-path-inside": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.2.0.tgz", "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", "requires": { - "path-is-inside": "^1.0.1" + "path-is-inside": "^1.2.0" } }, "is-plain-obj": { @@ -5065,7 +5065,7 @@ "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "requires": { - "has": "^1.0.1" + "has": "^1.2.0" } }, "is-regexp": { @@ -5242,8 +5242,8 @@ } }, "killable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/killable/-/killable-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/killable/-/killable-1.2.0.tgz", "integrity": "sha512-LzqtLKlUwirEUyl/nicirVmNiPvYs7l5n8wOPP7fyJVpUPkvCnW/vuiXGpylGUlnPDnB7311rARzAt3Mhswpjg==" }, "kind-of": { @@ -5273,7 +5273,7 @@ "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz", "integrity": "sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==", "requires": { - "uc.micro": "^1.0.1" + "uc.micro": "^1.2.0" } }, "load-script": { @@ -5293,12 +5293,12 @@ "requires": { "big.js": "^5.2.2", "emojis-list": "^2.0.0", - "json5": "^1.0.1" + "json5": "^1.2.0" }, "dependencies": { "json5": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.2.0.tgz", "integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==", "requires": { "minimist": "^1.2.0" @@ -5474,7 +5474,7 @@ "argparse": "^1.0.7", "entities": "~1.1.1", "linkify-it": "^2.0.0", - "mdurl": "^1.0.1", + "mdurl": "^1.2.0", "uc.micro": "^1.0.5" } }, @@ -5517,8 +5517,8 @@ } }, "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.2.0.tgz", "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=" }, "media-typer": { @@ -5546,8 +5546,8 @@ } }, "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.2.0.tgz", "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" }, "merge-source-map": { @@ -5601,7 +5601,7 @@ "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", "requires": { "bn.js": "^4.0.0", - "brorand": "^1.0.1" + "brorand": "^1.2.0" } }, "mime": { @@ -5658,13 +5658,13 @@ } }, "minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.2.0.tgz", "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" }, "minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.2.0.tgz", "integrity": "sha1-9sAMHAsIIkblxNmd+4x8CDsrWCo=" }, "minimatch": { @@ -5703,12 +5703,12 @@ "integrity": "sha512-8ZItLHeEgaqEvd5lYBXfm4EZSFCX29Jb9K+lAHhDKzReKBQKj3R+7NOF6tjqYi9t4oI8VUfaWITJQm86wnXGNQ==", "requires": { "for-in": "^1.0.2", - "is-extendable": "^1.0.1" + "is-extendable": "^1.2.0" }, "dependencies": { "is-extendable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.2.0.tgz", "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", "requires": { "is-plain-object": "^2.0.4" @@ -5732,8 +5732,8 @@ } }, "move-concurrently": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/move-concurrently/-/move-concurrently-1.2.0.tgz", "integrity": "sha1-viwAX9oy4LKa8fBdfEszIUxwH5I=", "requires": { "aproba": "^1.1.1", @@ -5861,8 +5861,8 @@ } }, "nopt": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.0.10.tgz", + "version": "1.2.00", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-1.2.00.tgz", "integrity": "sha1-bd0hvSoxQXuScn3Vhfim83YI6+4=", "requires": { "abbrev": "1" @@ -5916,8 +5916,8 @@ "integrity": "sha1-b2gragJ6Tp3fpFZM0lidHU5mnt4=" }, "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.2.0.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=" }, "oauth-sign": { @@ -5964,8 +5964,8 @@ "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==" }, "object-visit": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.2.0.tgz", "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", "requires": { "isobject": "^3.0.0" @@ -5979,7 +5979,7 @@ "define-properties": "^1.1.2", "function-bind": "^1.1.1", "has-symbols": "^1.0.0", - "object-keys": "^1.0.11" + "object-keys": "^1.2.01" } }, "object.getownpropertydescriptors": { @@ -6115,8 +6115,8 @@ "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==" }, "pako": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.10.tgz", + "version": "1.2.00", + "resolved": "https://registry.npmjs.org/pako/-/pako-1.2.00.tgz", "integrity": "sha512-0DTvPVU3ed8+HNXOu5Bs+o//Mbdj9VNQMUOe9oKCwh8l0GNwpTDMKCWbRjgtD291AWnkAgkqA/LOnQS8AmS1tw==" }, "parallel-transform": { @@ -6156,7 +6156,7 @@ "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", "requires": { "error-ex": "^1.3.1", - "json-parse-better-errors": "^1.0.1" + "json-parse-better-errors": "^1.2.0" } }, "parseurl": { @@ -6185,8 +6185,8 @@ "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=" }, "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.2.0.tgz", "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=" }, "path-is-inside": { @@ -6860,7 +6860,7 @@ "resolved": "https://registry.npmjs.org/postcss-merge-idents/-/postcss-merge-idents-2.1.7.tgz", "integrity": "sha1-TFUwMTwI4dWzu/PSu8dH4njuonA=", "requires": { - "has": "^1.0.1", + "has": "^1.2.0", "postcss": "^5.0.10", "postcss-value-parser": "^3.1.1" }, @@ -7173,7 +7173,7 @@ "resolved": "https://registry.npmjs.org/postcss-minify-params/-/postcss-minify-params-1.2.2.tgz", "integrity": "sha1-rSzgcTc7lDs9kwo/pZo1jCjW8fM=", "requires": { - "alphanum-sort": "^1.0.1", + "alphanum-sort": "^1.2.0", "postcss": "^5.0.2", "postcss-value-parser": "^3.0.2", "uniqs": "^2.0.0" @@ -7235,7 +7235,7 @@ "integrity": "sha1-ssapjAByz5G5MtGkllCBFDEXNb8=", "requires": { "alphanum-sort": "^1.0.2", - "has": "^1.0.1", + "has": "^1.2.0", "postcss": "^5.0.14", "postcss-selector-parser": "^2.0.0" }, @@ -7563,8 +7563,8 @@ } }, "postcss-reduce-initial": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/postcss-reduce-initial/-/postcss-reduce-initial-1.2.0.tgz", "integrity": "sha1-aPgGlfBF0IJjqHmtJA343WT2ROo=", "requires": { "postcss": "^5.0.4" @@ -7625,7 +7625,7 @@ "resolved": "https://registry.npmjs.org/postcss-reduce-transforms/-/postcss-reduce-transforms-1.0.4.tgz", "integrity": "sha1-/3b02CEkN7McKYpC0uFEQCV3GuE=", "requires": { - "has": "^1.0.1", + "has": "^1.2.0", "postcss": "^5.0.8", "postcss-value-parser": "^3.0.1" }, @@ -7686,8 +7686,8 @@ "integrity": "sha1-+UN3iGBsPJrO4W/+jYsWKX8nu5A=", "requires": { "flatten": "^1.0.2", - "indexes-of": "^1.0.1", - "uniq": "^1.0.1" + "indexes-of": "^1.2.0", + "uniq": "^1.2.0" } }, "postcss-svgo": { @@ -7756,7 +7756,7 @@ "resolved": "https://registry.npmjs.org/postcss-unique-selectors/-/postcss-unique-selectors-2.0.2.tgz", "integrity": "sha1-mB1X0p3csz57Hf4f1DuGSfkzyh0=", "requires": { - "alphanum-sort": "^1.0.1", + "alphanum-sort": "^1.2.0", "postcss": "^5.0.4", "uniqs": "^2.0.0" }, @@ -7821,7 +7821,7 @@ "resolved": "https://registry.npmjs.org/postcss-zindex/-/postcss-zindex-2.2.0.tgz", "integrity": "sha1-0hCd3AVbka9n/EyzsCWUZjnSryI=", "requires": { - "has": "^1.0.1", + "has": "^1.2.0", "postcss": "^5.0.4", "uniqs": "^2.0.0" }, @@ -7930,8 +7930,8 @@ "integrity": "sha512-MtEC1TqN0EU5nephaJ4rAtThHtC86dNN9qCuEhtshvpVBkAW5ZO7BASN9REnF9eoXGcRub+pFuKEpOHE+HbEMw==" }, "promise-inflight": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.2.0.tgz", "integrity": "sha1-mEcocL8igTL8vdhoEputEsPAKeM=" }, "proxy-addr": { @@ -7944,8 +7944,8 @@ } }, "prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/prr/-/prr-1.2.0.tgz", "integrity": "sha1-0/wRS6BplaRexok/SEzrHXj19HY=" }, "pseudomap": { @@ -8073,7 +8073,7 @@ "process-nextick-args": "~2.0.0", "safe-buffer": "~5.1.1", "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "util-deprecate": "~1.2.0" } }, "readdirp": { @@ -8101,7 +8101,7 @@ "requires": { "balanced-match": "^0.4.2", "math-expression-evaluator": "^1.2.14", - "reduce-function-call": "^1.0.1" + "reduce-function-call": "^1.2.0" }, "dependencies": { "balanced-match": { @@ -8275,8 +8275,8 @@ "integrity": "sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==" }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.2.0.tgz", "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=" }, "requires-port": { @@ -8818,7 +8818,7 @@ "requires": { "inherits": "^2.0.3", "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" + "util-deprecate": "^1.2.0" } } } @@ -8976,7 +8976,7 @@ "dev": true, "requires": { "get-own-enumerable-property-symbols": "^3.0.0", - "is-obj": "^1.0.1", + "is-obj": "^1.2.0", "is-regexp": "^1.0.0" } }, @@ -9077,7 +9077,7 @@ "resolved": "https://registry.npmjs.org/svgo/-/svgo-0.7.2.tgz", "integrity": "sha1-n1dyQTlSE1xv779Ar+ak+qiLS7U=", "requires": { - "coa": "~1.0.1", + "coa": "~1.2.0", "colors": "~1.1.2", "csso": "~2.3.1", "js-yaml": "~3.7.0", @@ -9165,8 +9165,8 @@ "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "mkdirp": "^0.5.1", - "move-concurrently": "^1.0.1", - "promise-inflight": "^1.0.1", + "move-concurrently": "^1.2.0", + "promise-inflight": "^1.2.0", "rimraf": "^2.6.2", "ssri": "^6.0.1", "unique-filename": "^1.1.1", @@ -9258,8 +9258,8 @@ "optional": true }, "to-arraybuffer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/to-arraybuffer/-/to-arraybuffer-1.2.0.tgz", "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=" }, "to-factory": { @@ -9346,8 +9346,8 @@ } }, "trim-right": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.2.0.tgz", "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=" }, "tslib": { @@ -9465,8 +9465,8 @@ } }, "uniq": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.2.0.tgz", "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" }, "uniqs": { @@ -9639,8 +9639,8 @@ "integrity": "sha1-ihagXURWV6Oupe7MWxKk+lN5dyw=" }, "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.2.0.tgz", "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" }, "uuid": { @@ -10224,7 +10224,7 @@ "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-2.1.0.tgz", "integrity": "sha1-2Pw9KE3QV5T+hJc8rs3Rz4JP3YU=", "requires": { - "string-width": "^1.0.1", + "string-width": "^1.2.0", "strip-ansi": "^3.0.1" }, "dependencies": { @@ -10281,10 +10281,10 @@ "cliui": "^4.0.0", "decamelize": "^2.0.0", "find-up": "^3.0.0", - "get-caller-file": "^1.0.1", + "get-caller-file": "^1.2.0", "os-locale": "^3.0.0", "require-directory": "^2.1.1", - "require-main-filename": "^1.0.1", + "require-main-filename": "^1.2.0", "set-blocking": "^2.0.0", "string-width": "^2.0.0", "which-module": "^2.0.0", diff --git a/dist/0xcert-cert.min.js b/dist/0xcert-cert.min.js index 9eeb4f4b2..c33c8ccf9 100644 --- a/dist/0xcert-cert.min.js +++ b/dist/0xcert-cert.min.js @@ -1 +1 @@ -!function(e){var t={};function n(o){if(t[o])return t[o].exports;var i=t[o]={i:o,l:!1,exports:{}};return e[o].call(i.exports,i,i.exports,n),i.l=!0,i.exports}n.m=e,n.c=t,n.d=function(e,t,o){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:o})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var o=Object.create(null);if(n.r(o),Object.defineProperty(o,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(o,i,function(t){return e[t]}.bind(null,i));return o},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=96)}({16:function(e,t,n){"use strict";function o(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),o(n(18)),o(n(20)),o(n(22)),o(n(24)),o(n(25)),o(n(26)),o(n(27)),o(n(28))},18:function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function c(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,c)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.fetch=function(e,t){return o(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(e,t):n(19)(e,t)})}},19:function(e,t,n){"use strict";var o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==o)return o;throw new Error("unable to locate global object")}();e.exports=t=o.fetch,t.default=o.fetch.bind(o),t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response},20:function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function c(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,c)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.sha=function(e,t){return o(this,void 0,void 0,function*(){if("undefined"!=typeof window){const n=new window.TextEncoder("utf-8").encode(t),o=yield window.crypto.subtle.digest(`SHA-${e}`,n);return Array.from(new Uint8Array(o)).map(e=>`00${e.toString(16)}`.slice(-2)).join("")}return n(21).createHash(`sha${e}`).update(t).digest("hex")})}},21:function(e,t){e.exports=void 0},22:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(23);t.keccak256=function(e){return o.keccak256(e)}},23:function(e,t){const n="0123456789abcdef".split(""),o=[1,256,65536,16777216],i=[0,8,16,24],r=[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],s=e=>{var t,n,o,i,s,c,u,a,l,h,f,d,p,y,v,b,m,j,O,_,k,x,P,g,w,E,M,S,$,A,I,N,R,C,F,L,D,z,H,J,B,T,U,V,G,q,X,K,Q,W,Y,Z,ee,te,ne,oe,ie,re,se,ce,ue,ae,le;for(o=0;o<48;o+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],c=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(c<<1|u>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|c>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(a<<1|l>>>31),n=s^(l<<1|a>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=c^(h<<1|f>>>31),n=u^(f<<1|h>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=a^(d<<1|p>>>31),n=l^(p<<1|d>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=h^(i<<1|s>>>31),n=f^(s<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,y=e[0],v=e[1],q=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,S=e[20]<<3|e[21]>>>29,$=e[21]<<3|e[20]>>>29,ce=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,T=e[40]<<18|e[41]>>>14,U=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,F=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,A=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,ae=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,j=e[25]<<11|e[24]>>>21,O=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,g=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,oe=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,z=e[26]<<25|e[27]>>>7,H=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,re=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,J=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,P=e[49]<<14|e[48]>>>18,e[0]=y^~b&j,e[1]=v^~m&O,e[10]=g^~E&S,e[11]=w^~M&$,e[20]=C^~L&z,e[21]=F^~D&H,e[30]=V^~q&K,e[31]=G^~X&Q,e[40]=te^~oe&re,e[41]=ne^~ie&se,e[2]=b^~j&_,e[3]=m^~O&k,e[12]=E^~S&A,e[13]=M^~$&I,e[22]=L^~z&J,e[23]=D^~H&B,e[32]=q^~K&W,e[33]=X^~Q&Y,e[42]=oe^~re&ce,e[43]=ie^~se&ue,e[4]=j^~_&x,e[5]=O^~k&P,e[14]=S^~A&N,e[15]=$^~I&R,e[24]=z^~J&T,e[25]=H^~B&U,e[34]=K^~W&Z,e[35]=Q^~Y&ee,e[44]=re^~ce&ae,e[45]=se^~ue&le,e[6]=_^~x&y,e[7]=k^~P&v,e[16]=A^~N&g,e[17]=I^~R&w,e[26]=J^~T&C,e[27]=B^~U&F,e[36]=W^~Z&V,e[37]=Y^~ee&G,e[46]=ce^~ae&te,e[47]=ue^~le&ne,e[8]=x^~y&b,e[9]=P^~v&m,e[18]=N^~g&E,e[19]=R^~w&M,e[28]=T^~C&L,e[29]=U^~F&D,e[38]=Z^~V&q,e[39]=ee^~G&X,e[48]=ae^~te&oe,e[49]=le^~ne&ie,e[0]^=r[o],e[1]^=r[o+1]},c=e=>t=>{var r;if("0x"===t.slice(0,2)){r=[];for(var c=2,u=t.length;c{for(var r,c=t.length,u=e.blocks,a=e.blockCount<<2,l=e.blockCount,h=e.outputBlocks,f=e.s,d=0;d>2]|=t[d]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(u[v>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=a){for(e.start=v-a,e.block=u[l],v=0;v>2]|=o[3&v],e.lastByteIndex===a)for(u[0]=u[l],v=1;v>4&15]+n[15&p]+n[p>>12&15]+n[p>>8&15]+n[p>>20&15]+n[p>>16&15]+n[p>>28&15]+n[p>>24&15];b%l==0&&(s(f),v=0)}return"0x"+y})((e=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}))(e),r)};e.exports={keccak256:c(256),keccak512:c(512),keccak256s:c(256),keccak512s:c(512)}},24:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=function(e){return parseFloat(`${e}`)||0}},25:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},26:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=function(e){return parseInt(`${parseFloat(`${e}`)/1e3}`)||0}},27:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=function(e){return null!=e?e.toString():null}},28:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=function e(t){if(!(t instanceof Object))return[];const n=[];let o=0;return Object.keys(t).forEach(i=>{if(t[i]instanceof Object)n[o]=e(t[i]);else if(t[i]instanceof Array){let r=0;const s=[];t[i].forEach(n=>{s[r]=e(t[i]),r++}),n[o]=s}else n[o]=t[i];o++}),n}},46:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(47))},47:function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function c(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,c)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const i=n(48),r=n(16),s=n(50);class c{static getInstance(e){return new c(e)}constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>o(this,void 0,void 0,function*(){return r.sha(256,s.toString(e))}),noncer:e=>o(this,void 0,void 0,function*(){return r.sha(256,e.join("."))})},e))}notarize(e){return o(this,void 0,void 0,function*(){const t=this.buildSchemaProps(e),n=yield this.buildCompoundProps(t);return(yield this.buildRecipes(n)).map(e=>({path:e.path,nodes:e.nodes,values:e.values}))})}expose(e,t){const n={};return t.forEach(t=>{const o=s.readPath(t,e);s.writePath(t,o,n)}),JSON.parse(JSON.stringify(n))}disclose(e,t){return o(this,void 0,void 0,function*(){const n=this.buildSchemaProps(e),o=yield this.buildCompoundProps(n);return(yield this.buildRecipes(o,t)).map(e=>({path:e.path,nodes:e.nodes,values:e.values}))})}calculate(e,t){return o(this,void 0,void 0,function*(){try{return this.checkDataInclusion(e,t)?this.imprintRecipes(t):null}catch(e){return null}})}imprint(e){return o(this,void 0,void 0,function*(){return this.notarize(e).then(e=>e[0].nodes[0].hash)})}buildSchemaProps(e,t=this.schema,n=[]){return"array"===t.type?(e||[]).map((e,o)=>this.buildSchemaProps(e,t.items,[...n,o])).reduce((e,t)=>e.concat(t),[]):"object"===t.type?Object.keys(t.properties).sort().map(o=>{const i=this.buildSchemaProps((e||{})[o],t.properties[o],[...n,o]);return-1===["object","array"].indexOf(t.properties[o].type)?[i]:i}).reduce((e,t)=>e.concat(t),[]):{path:n,value:e,key:n.join("."),group:n.slice(0,-1).join(".")}}buildCompoundProps(e){return o(this,void 0,void 0,function*(){e=[...e];const t=this.buildPropGroups(e),n=Object.keys(t).sort((e,t)=>e>t?-1:1).filter(e=>""!==e);for(const o of n){const n=t[o],i=[...e.filter(e=>e.group===o)].sort((e,t)=>e.key>t.key?1:-1).map(e=>e.value),r=yield this.merkle.notarize(i,n);e.push({path:n,value:r.nodes[0].hash,key:n.join("."),group:n.slice(0,-1).join(".")})}return e.sort((e,t)=>e.key>t.key?1:-1)})}buildRecipes(e,t=null){return o(this,void 0,void 0,function*(){const n=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=>o(this,void 0,void 0,function*(){const o=e.filter(e=>e.group===t).map(e=>e.value);let r=yield this.merkle.notarize(o,i[t]);if(n){const o=e.filter(e=>e.group===t).map((e,t)=>-1===n.indexOf(e.key)?-1:t).filter(e=>-1!==e);r=yield this.merkle.disclose(r,o)}if(!n||-1!==n.indexOf(i[t].join(".")))return{path:i[t],values:r.values,nodes:r.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))).then(e=>e.filter(e=>!!e))})}checkDataInclusion(e,t){const n=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 o of n){const n=s.readPath(o.path,e);if(void 0===n)continue;const i=o.path.slice(0,-1).join("."),r=t.find(e=>e.key===i);if(!r)return!1;const c=this.getPathIndexes(o.path).pop();if(r.values.find(e=>e.index===c).value!==n)return!1}return!0}imprintRecipes(e){return o(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 n=yield this.merkle.imprint(t).catch(()=>"");t.nodes.unshift({index:0,hash:n});const o=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),r=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find(e=>e.key===o);s&&s.values.unshift({index:r,value:n,nonce:yield this.merkle.nonce([...i,r])})}const t=e.find(e=>""===e.key);return t?t.nodes.find(e=>0===e.index).hash:this.getEmptyImprint()})}getPathIndexes(e){const t=[];let n=this.schema;for(const o of e)"array"===n.type?(t.push(o),n=n.items):"object"===n.type?(t.push(Object.keys(n.properties).sort().indexOf(o)),n=n.properties[o]):t.push(void 0);return t}getEmptyImprint(){return o(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}}t.Cert=c},48:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(49))},49:function(e,t,n){"use strict";var o,i=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function c(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,c)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(o=t.MerkleHasherPosition||(t.MerkleHasherPosition={}));t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,n){return this._options.hasher(e,t,n)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return i(this,void 0,void 0,function*(){const n=[...e],i=[],r=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(r,[...t,n.length],o.NODE)];for(let e=n.length-1;e>=0;e--){const r=s[0];i.unshift(yield this._options.noncer([...t,e]));const c=yield this._options.hasher(n[e],[...t,e],o.VALUE);s.unshift(yield this._options.hasher(`${c}${i[0]}`,[...t,e],o.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${r}`,[...t,e],o.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 i(this,void 0,void 0,function*(){const n=Math.max(...t.map(e=>e+1),0),o=[],i=[e.nodes.find(e=>e.index===2*n)];for(let r=n-1;r>=0;r--)-1!==t.indexOf(r)?o.unshift(e.values.find(e=>e.index===r)):i.unshift(e.nodes.find(e=>e.index===2*r+1));return{values:o,nodes:i}})}imprint(e){return i(this,void 0,void 0,function*(){const t=[...yield Promise.all(e.values.map((e,t)=>i(this,void 0,void 0,function*(){const n=yield this._options.hasher(e.value,[t],o.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],o.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],o.NODE)})}const n=t.find(e=>0===e.index);return n?n.hash:null})}}},50:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!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 n=[];e.forEach(e=>{n.push(e),t[n.join(".")]=[...n]})}),Object.keys(t).sort().map(e=>t[e])},t.readPath=function e(t,n){try{return Array.isArray(t)?0===t.length?n:e(t.slice(1),n[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,n={}){let o=n=n||{};for(let n=0;n`00${e.toString(16)}`.slice(-2)).join("")}return n(22).createHash(`sha${e}`).update(t).digest("hex")})}},22:function(e,t){e.exports=void 0},23:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});const o=n(24);t.keccak256=function(e){return o.keccak256(e)}},24:function(e,t){const n="0123456789abcdef".split(""),o=[1,256,65536,16777216],i=[0,8,16,24],r=[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],s=e=>{var t,n,o,i,s,c,u,a,l,h,f,d,p,y,v,b,m,j,O,_,k,x,P,g,w,E,M,S,$,A,I,N,R,C,F,L,D,z,H,J,B,T,U,V,G,q,X,K,Q,W,Y,Z,ee,te,ne,oe,ie,re,se,ce,ue,ae,le;for(o=0;o<48;o+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],c=e[2]^e[12]^e[22]^e[32]^e[42],u=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(d=e[8]^e[18]^e[28]^e[38]^e[48])^(c<<1|u>>>31),n=(p=e[9]^e[19]^e[29]^e[39]^e[49])^(u<<1|c>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(a<<1|l>>>31),n=s^(l<<1|a>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=c^(h<<1|f>>>31),n=u^(f<<1|h>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=a^(d<<1|p>>>31),n=l^(p<<1|d>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=h^(i<<1|s>>>31),n=f^(s<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,y=e[0],v=e[1],q=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,S=e[20]<<3|e[21]>>>29,$=e[21]<<3|e[20]>>>29,ce=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,T=e[40]<<18|e[41]>>>14,U=e[41]<<18|e[40]>>>14,C=e[2]<<1|e[3]>>>31,F=e[3]<<1|e[2]>>>31,b=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,K=e[22]<<10|e[23]>>>22,Q=e[23]<<10|e[22]>>>22,A=e[33]<<13|e[32]>>>19,I=e[32]<<13|e[33]>>>19,ae=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,D=e[15]<<6|e[14]>>>26,j=e[25]<<11|e[24]>>>21,O=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,Y=e[35]<<15|e[34]>>>17,N=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,g=e[6]<<28|e[7]>>>4,w=e[7]<<28|e[6]>>>4,oe=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,z=e[26]<<25|e[27]>>>7,H=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,k=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,G=e[9]<<27|e[8]>>>5,E=e[18]<<20|e[19]>>>12,M=e[19]<<20|e[18]>>>12,re=e[29]<<7|e[28]>>>25,se=e[28]<<7|e[29]>>>25,J=e[38]<<8|e[39]>>>24,B=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,P=e[49]<<14|e[48]>>>18,e[0]=y^~b&j,e[1]=v^~m&O,e[10]=g^~E&S,e[11]=w^~M&$,e[20]=C^~L&z,e[21]=F^~D&H,e[30]=V^~q&K,e[31]=G^~X&Q,e[40]=te^~oe&re,e[41]=ne^~ie&se,e[2]=b^~j&_,e[3]=m^~O&k,e[12]=E^~S&A,e[13]=M^~$&I,e[22]=L^~z&J,e[23]=D^~H&B,e[32]=q^~K&W,e[33]=X^~Q&Y,e[42]=oe^~re&ce,e[43]=ie^~se&ue,e[4]=j^~_&x,e[5]=O^~k&P,e[14]=S^~A&N,e[15]=$^~I&R,e[24]=z^~J&T,e[25]=H^~B&U,e[34]=K^~W&Z,e[35]=Q^~Y&ee,e[44]=re^~ce&ae,e[45]=se^~ue&le,e[6]=_^~x&y,e[7]=k^~P&v,e[16]=A^~N&g,e[17]=I^~R&w,e[26]=J^~T&C,e[27]=B^~U&F,e[36]=W^~Z&V,e[37]=Y^~ee&G,e[46]=ce^~ae&te,e[47]=ue^~le&ne,e[8]=x^~y&b,e[9]=P^~v&m,e[18]=N^~g&E,e[19]=R^~w&M,e[28]=T^~C&L,e[29]=U^~F&D,e[38]=Z^~V&q,e[39]=ee^~G&X,e[48]=ae^~te&oe,e[49]=le^~ne&ie,e[0]^=r[o],e[1]^=r[o+1]},c=e=>t=>{var r;if("0x"===t.slice(0,2)){r=[];for(var c=2,u=t.length;c{for(var r,c=t.length,u=e.blocks,a=e.blockCount<<2,l=e.blockCount,h=e.outputBlocks,f=e.s,d=0;d>2]|=t[d]<>2]|=r<>2]|=(192|r>>6)<>2]|=(128|63&r)<=57344?(u[v>>2]|=(224|r>>12)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<>2]|=(240|r>>18)<>2]|=(128|r>>12&63)<>2]|=(128|r>>6&63)<>2]|=(128|63&r)<=a){for(e.start=v-a,e.block=u[l],v=0;v>2]|=o[3&v],e.lastByteIndex===a)for(u[0]=u[l],v=1;v>4&15]+n[15&p]+n[p>>12&15]+n[p>>8&15]+n[p>>20&15]+n[p>>16&15]+n[p>>28&15]+n[p>>24&15];b%l==0&&(s(f),v=0)}return"0x"+y})((e=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(e<<1)>>5,outputBlocks:e>>5,s:(e=>[].concat(e,e,e,e,e))([0,0,0,0,0,0,0,0,0,0])}))(e),r)};e.exports={keccak256:c(256),keccak512:c(512),keccak256s:c(256),keccak512s:c(512)}},25:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toFloat=function(e){return parseFloat(`${e}`)||0}},26:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toInteger=function(e){return"number"==typeof e&&e>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof e&&!0===e?1:parseInt(`${e}`)||0}},27:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toSeconds=function(e){return parseInt(`${parseFloat(`${e}`)/1e3}`)||0}},28:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toString=function(e){return null!=e?e.toString():null}},29:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.toTuple=function e(t){if(!(t instanceof Object))return[];const n=[];let o=0;return Object.keys(t).forEach(i=>{if(t[i]instanceof Object)n[o]=e(t[i]);else if(t[i]instanceof Array){let r=0;const s=[];t[i].forEach(n=>{s[r]=e(t[i]),r++}),n[o]=s}else n[o]=t[i];o++}),n}},92:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(93))},93:function(e,t,n){"use strict";var o=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function c(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,c)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0});const i=n(94),r=n(17),s=n(96);class c{static getInstance(e){return new c(e)}constructor(e){this.schema=e.schema,this.merkle=new i.Merkle(Object.assign({hasher:e=>o(this,void 0,void 0,function*(){return r.sha(256,s.toString(e))}),noncer:e=>o(this,void 0,void 0,function*(){return r.sha(256,e.join("."))})},e))}notarize(e){return o(this,void 0,void 0,function*(){const t=this.buildSchemaProps(e),n=yield this.buildCompoundProps(t);return(yield this.buildRecipes(n)).map(e=>({path:e.path,nodes:e.nodes,values:e.values}))})}expose(e,t){const n={};return t.forEach(t=>{const o=s.readPath(t,e);s.writePath(t,o,n)}),JSON.parse(JSON.stringify(n))}disclose(e,t){return o(this,void 0,void 0,function*(){const n=this.buildSchemaProps(e),o=yield this.buildCompoundProps(n);return(yield this.buildRecipes(o,t)).map(e=>({path:e.path,nodes:e.nodes,values:e.values}))})}calculate(e,t){return o(this,void 0,void 0,function*(){try{return this.checkDataInclusion(e,t)?this.imprintRecipes(t):null}catch(e){return null}})}imprint(e){return o(this,void 0,void 0,function*(){return this.notarize(e).then(e=>e[0].nodes[0].hash)})}buildSchemaProps(e,t=this.schema,n=[]){return"array"===t.type?(e||[]).map((e,o)=>this.buildSchemaProps(e,t.items,[...n,o])).reduce((e,t)=>e.concat(t),[]):"object"===t.type?Object.keys(t.properties).sort().map(o=>{const i=this.buildSchemaProps((e||{})[o],t.properties[o],[...n,o]);return-1===["object","array"].indexOf(t.properties[o].type)?[i]:i}).reduce((e,t)=>e.concat(t),[]):{path:n,value:e,key:n.join("."),group:n.slice(0,-1).join(".")}}buildCompoundProps(e){return o(this,void 0,void 0,function*(){e=[...e];const t=this.buildPropGroups(e),n=Object.keys(t).sort((e,t)=>e>t?-1:1).filter(e=>""!==e);for(const o of n){const n=t[o],i=[...e.filter(e=>e.group===o)].sort((e,t)=>e.key>t.key?1:-1).map(e=>e.value),r=yield this.merkle.notarize(i,n);e.push({path:n,value:r.nodes[0].hash,key:n.join("."),group:n.slice(0,-1).join(".")})}return e.sort((e,t)=>e.key>t.key?1:-1)})}buildRecipes(e,t=null){return o(this,void 0,void 0,function*(){const n=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=>o(this,void 0,void 0,function*(){const o=e.filter(e=>e.group===t).map(e=>e.value);let r=yield this.merkle.notarize(o,i[t]);if(n){const o=e.filter(e=>e.group===t).map((e,t)=>-1===n.indexOf(e.key)?-1:t).filter(e=>-1!==e);r=yield this.merkle.disclose(r,o)}if(!n||-1!==n.indexOf(i[t].join(".")))return{path:i[t],values:r.values,nodes:r.nodes,key:i[t].join("."),group:i[t].slice(0,-1).join(".")}}))).then(e=>e.filter(e=>!!e))})}checkDataInclusion(e,t){const n=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 o of n){const n=s.readPath(o.path,e);if(void 0===n)continue;const i=o.path.slice(0,-1).join("."),r=t.find(e=>e.key===i);if(!r)return!1;const c=this.getPathIndexes(o.path).pop();if(r.values.find(e=>e.index===c).value!==n)return!1}return!0}imprintRecipes(e){return o(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 n=yield this.merkle.imprint(t).catch(()=>"");t.nodes.unshift({index:0,hash:n});const o=t.path.slice(0,-1).join("."),i=t.path.slice(0,-1),r=this.getPathIndexes(t.path).slice(-1).pop(),s=e.find(e=>e.key===o);s&&s.values.unshift({index:r,value:n,nonce:yield this.merkle.nonce([...i,r])})}const t=e.find(e=>""===e.key);return t?t.nodes.find(e=>0===e.index).hash:this.getEmptyImprint()})}getPathIndexes(e){const t=[];let n=this.schema;for(const o of e)"array"===n.type?(t.push(o),n=n.items):"object"===n.type?(t.push(Object.keys(n.properties).sort().indexOf(o)),n=n.properties[o]):t.push(void 0);return t}getEmptyImprint(){return o(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}}t.Cert=c},94:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}(n(95))},95:function(e,t,n){"use strict";var o,i=this&&this.__awaiter||function(e,t,n,o){return new(n||(n=Promise))(function(i,r){function s(e){try{u(o.next(e))}catch(e){r(e)}}function c(e){try{u(o.throw(e))}catch(e){r(e)}}function u(e){e.done?i(e.value):new n(function(t){t(e.value)}).then(s,c)}u((o=o.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),function(e){e[e.VALUE=0]="VALUE",e[e.LEAF=1]="LEAF",e[e.NODE=2]="NODE"}(o=t.MerkleHasherPosition||(t.MerkleHasherPosition={}));t.Merkle=class{constructor(e){this._options=Object.assign({hasher:e=>e,noncer:()=>""},e)}hash(e,t,n){return this._options.hasher(e,t,n)}nonce(e){return this._options.noncer(e)}notarize(e,t=[]){return i(this,void 0,void 0,function*(){const n=[...e],i=[],r=yield this._options.noncer([...t,n.length]),s=[yield this._options.hasher(r,[...t,n.length],o.NODE)];for(let e=n.length-1;e>=0;e--){const r=s[0];i.unshift(yield this._options.noncer([...t,e]));const c=yield this._options.hasher(n[e],[...t,e],o.VALUE);s.unshift(yield this._options.hasher(`${c}${i[0]}`,[...t,e],o.LEAF));const u=s[0];s.unshift(yield this._options.hasher(`${u}${r}`,[...t,e],o.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 i(this,void 0,void 0,function*(){const n=Math.max(...t.map(e=>e+1),0),o=[],i=[e.nodes.find(e=>e.index===2*n)];for(let r=n-1;r>=0;r--)-1!==t.indexOf(r)?o.unshift(e.values.find(e=>e.index===r)):i.unshift(e.nodes.find(e=>e.index===2*r+1));return{values:o,nodes:i}})}imprint(e){return i(this,void 0,void 0,function*(){const t=[...yield Promise.all(e.values.map((e,t)=>i(this,void 0,void 0,function*(){const n=yield this._options.hasher(e.value,[t],o.VALUE);return{index:2*e.index+1,hash:yield this._options.hasher(`${n}${e.nonce}`,[t],o.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],o.NODE)})}const n=t.find(e=>0===e.index);return n?n.hash:null})}}},96:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!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 n=[];e.forEach(e=>{n.push(e),t[n.join(".")]=[...n]})}),Object.keys(t).sort().map(e=>t[e])},t.readPath=function e(t,n){try{return Array.isArray(t)?0===t.length?n:e(t.slice(1),n[t[0]]):void 0}catch(e){return}},t.writePath=function(e,t,n={}){let o=n=n||{};for(let n=0;n=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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(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 f(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=d(t.r,32),o=d(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 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,e+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=d,e.splitSignature=f,e.joinSignature=function(t){return c(a([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5)),n(r(29)),n(r(6)),n(r(17))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(2),s=r(34),u=r(38),a=r(4);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var d,f=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/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 n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function v(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new i.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(u.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,d=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=d;f++){var p=h-f|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[f])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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=l[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: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}n(!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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,m=0|s[2],y=8191&m,g=m>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],A=8191&b,E=b>>>13,x=0|s[5],T=8191&x,N=x>>>13,I=0|s[6],P=8191&I,S=I>>>13,O=0|s[7],R=8191&O,L=O>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,V=B>>>13,z=0|u[1],Z=8191&z,q=z>>>13,$=0|u[2],H=8191&$,K=$>>>13,W=0|u[3],J=8191&W,X=W>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,dt=lt>>>13,ft=0|u[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(d,F)|0))<<13)|0;h=((o=Math.imul(d,V))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(v,F)|0,o=Math.imul(v,V);var yt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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 gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(d,H)|0))<<13)|0;h=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,K)|0;var wt=(h+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(d,J)|0))<<13)|0;h=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,V))+Math.imul(E,F)|0,o=Math.imul(E,V),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,V))+Math.imul(N,F)|0,o=Math.imul(N,V),n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(S,F)|0,o=Math.imul(S,V),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,K)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(d,at)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ht)|0;var Et=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,dt)|0)+Math.imul(d,ct)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(v,ct)|0,o=o+Math.imul(v,dt)|0;var xt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,vt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(D,Z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,dt)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,at)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,dt)|0;var Nt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,J),i=(i=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,ct)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(E,ct)|0,o=o+Math.imul(E,dt)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(N,ct)|0,o=o+Math.imul(N,dt)|0;var Pt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,dt)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,ct)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,dt)|0;var Ot=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,dt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,dt))+Math.imul(D,ct)|0,o=Math.imul(D,dt);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,vt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,vt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,vt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=mt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=At,a[8]=Et,a[9]=xt,a[10]=Tt,a[11]=Nt,a[12]=It,a[13]=Pt,a[14]=St,a[15]=Ot,a[16]=Rt,a[17]=Lt,a[18]=kt,0!==h&&(a[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=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n: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,n=0;n>=1;return n},v.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var d=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,c);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=d)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),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;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,d=1;0==(r.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(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 y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}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 g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(u);){for(var v=f,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,b),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(8)),a=r(2),h=r(10),l=r(39),c=s(r(4)),d=new u.default.BN(-1);function f(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 p(t){return y(t)._bn}function v(t){return new m(f(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",f(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",f(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(d):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return v(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return v(this._bn.toTwos(t))},e.prototype.add=function(t){return v(this._bn.add(p(t)))},e.prototype.sub=function(t){return v(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),v(this._bn.div(p(t)))},e.prototype.mul=function(t){return v(this._bn.mul(p(t)))},e.prototype.mod=function(t){return v(this._bn.mod(p(t)))},e.prototype.pow=function(t){return v(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return v(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof m?t:new m(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return d(this,t,!0)},u.prototype.rawListeners=function(t){return d(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(20)),n(r(22)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(19)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(21).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(23);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,d,f,p,v,m,y,g,w,M,_,b,A,E,x,T,N,I,P,S,O,R,L,k,C,j,U,G,D,B,F,V,z,Z,q,$,H,K,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|d>>>31),r=a^(d<<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=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=c^(i<<1|s>>>31),r=d^(s<<1|i>>>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],m=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,N=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,V=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&M,t[10]=x^~N&P,t[11]=T^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&W,t[31]=$^~K&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=N^~P&O,t[13]=I^~S&R,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~W&X,t[33]=K^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&A,t[5]=M^~b&E,t[14]=P^~O&L,t[15]=S^~R&k,t[24]=D^~F&z,t[25]=B^~V&Z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=O^~L&x,t[17]=R^~k&T,t[26]=F^~z&C,t[27]=V^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&N,t[19]=k^~T&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,d=t.s,f=0;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=m-h,t.block=a[l],m=0;m>2]|=n[3&m],t.lastByteIndex===h)for(a[0]=a[l],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(d),m=0)}return"0x"+v})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(7),u=r(9),a=r(2),h=r(40),l=r(10),c=o(r(4)),d=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(f);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),A=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(2);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=104)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+c[15&a])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(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 f(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=d(t.r,32),o=d(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,e+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=d,e.splitSignature=f,e.joinSignature=function(t){return l(a([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(l=0;l<26;l++)c[String.fromCharCode(65+l)]=String(10+l);var d,f=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/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+=c[t]});e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function v(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new i.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(u.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),c=r(11),l=o(r(3)),d=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(f);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),A=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){l.throwError("invalid number value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){l.throwError("invalid "+this.name+" value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||l.throwError("expected array value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),l.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&l.throwError("invalid "+r[1]+" bit length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[1]))||i>32)&&l.throwError("invalid bytes length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=c.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){l.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&l.throwError("types/values length mismatch",l.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):c.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,l=67108863&a,d=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=d;f++){var p=h-f|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[f])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,a=0|c}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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}n(!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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),c=this.clone();if(a){for(u=0;!c.isZero();u++)s=c.andln(255),c.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,m=0|s[2],y=8191&m,g=m>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],A=8191&b,E=b>>>13,x=0|s[5],T=8191&x,N=x>>>13,I=0|s[6],P=8191&I,S=I>>>13,O=0|s[7],R=8191&O,L=O>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,z=B>>>13,V=0|u[1],Z=8191&V,q=V>>>13,$=0|u[2],H=8191&$,K=$>>>13,W=0|u[3],J=8191&W,X=W>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,ct=0|u[8],lt=8191&ct,dt=ct>>>13,ft=0|u[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,F)|0))<<13)|0;h=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(v,F)|0,o=Math.imul(v,z);var yt=(h+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,z))+Math.imul(g,F)|0,o=Math.imul(g,z),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 gt=(h+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(d,H)|0))<<13)|0;h=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,z))+Math.imul(_,F)|0,o=Math.imul(_,z),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,K)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,J)|0))<<13)|0;h=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0;var Mt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,z))+Math.imul(N,F)|0,o=Math.imul(N,z),n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,K)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var bt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(L,F)|0,o=Math.imul(L,z),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(h+(n=n+Math.imul(l,at)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(d,at)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ht)|0;var Et=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,vt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(D,Z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,at)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,dt)|0;var Nt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,J),i=(i=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,dt)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0;var Pt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,dt)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0;var Ot=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,dt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,lt),i=(i=Math.imul(G,dt))+Math.imul(D,lt)|0,o=Math.imul(D,dt);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,vt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,vt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,vt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=mt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=At,a[8]=Et,a[9]=xt,a[10]=Tt,a[11]=Nt,a[12]=It,a[13]=Pt,a[14]=St,a[15]=Ot,a[16]=Rt,a[17]=Lt,a[18]=kt,0!==h&&(a[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=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n: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,n=0;n>=1;return n},v.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&u}return a&&0!==c&&(a.words[a.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(l)),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;)(u.isOdd()||a.isOdd())&&(u.iadd(c),a.isub(l)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(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 y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}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 g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(a);)c.redIAdd(a);for(var l=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(u);){for(var v=f,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var h=e.words[n],c=a-1;c>=0;c--){var l=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++u||0===n&&0===c)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,b),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),c=r(39),l=s(r(3)),d=new u.default.BN(-1);function f(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 p(t){return y(t)._bn}function v(t){return new m(f(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(l.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))):l.throwError("invalid BigNumber string value",l.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&l.throwError("underflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",f(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",f(new u.default.BN(a.hexlify(r).substring(2),16))):l.throwError("invalid BigNumber value",l.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(d):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return v(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return v(this._bn.toTwos(t))},e.prototype.add=function(t){return v(this._bn.add(p(t)))},e.prototype.sub=function(t){return v(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&l.throwError("division by zero",l.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),v(this._bn.div(p(t)))},e.prototype.mul=function(t){return v(this._bn.mul(p(t)))},e.prototype.mod=function(t){return v(this._bn.mod(p(t)))},e.prototype.pow=function(t){return v(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return v(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(c.BigNumber);function y(t){return t instanceof m?t:new m(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,c=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return d(this,t,!0)},u.prototype.rawListeners=function(t){return d(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,c,l,d,f,p,v,m,y,g,w,M,_,b,A,E,x,T,N,I,P,S,O,R,L,k,C,j,U,G,D,B,F,z,V,Z,q,$,H,K,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(h<<1|c>>>31),r=s^(c<<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=u^(l<<1|d>>>31),r=a^(d<<1|l>>>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=c^(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=l^(i<<1|s>>>31),r=d^(s<<1|i>>>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],m=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,N=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,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&M,t[10]=x^~N&P,t[11]=T^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&W,t[31]=$^~K&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=N^~P&O,t[13]=I^~S&R,t[22]=U^~D&F,t[23]=G^~B&z,t[32]=H^~W&X,t[33]=K^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&A,t[5]=M^~b&E,t[14]=P^~O&L,t[15]=S^~R&k,t[24]=D^~F&V,t[25]=B^~z&Z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=O^~L&x,t[17]=R^~k&T,t[26]=F^~V&C,t[27]=z^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~ct&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&N,t[19]=k^~T&I,t[28]=V^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,c=t.blockCount,l=t.outputBlocks,d=t.s,f=0;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=m-h,t.block=a[c],m=0;m>2]|=n[3&m],t.lastByteIndex===h)for(a[0]=a[c],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%c==0&&(s(d),m=0)}return"0x"+v})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -7,4 +7,4 @@ * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},d=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,d,f,p,v,m,y,g,w,M,_,b,A,E,x,T,N,I,P,S,O,R,L,k,C,j,U,G,D,B,F,V,z,Z,q,$,H,K,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|d>>>31),r=a^(d<<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=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=c^(i<<1|o>>>31),r=d^(o<<1|i>>>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],m=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,N=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,V=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&M,t[10]=x^~N&P,t[11]=T^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&W,t[31]=$^~K&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=N^~P&O,t[13]=I^~S&R,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~W&X,t[33]=K^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&A,t[5]=M^~b&E,t[14]=P^~O&L,t[15]=S^~R&k,t[24]=D^~F&z,t[25]=B^~V&Z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=O^~L&x,t[17]=R^~k&T,t[26]=F^~z&C,t[27]=V^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&N,t[19]=k^~T&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(m=0;m1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),o=r(3),s=r(13);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedi.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=i.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>i.normalizeAddress(t))})}getNetworkVersion(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===i.normalizeAddress(t)}isUnsafeRecipientId(t){const e=i.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.getInterfaceCode=function(t){return t==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==n.AssetLedgerCapability.UPDATE_ASSET?"0xbda0e852":t==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);e.GeneralAssetLedgerAbility=n.GeneralAssetLedgerAbility,e.SuperAssetLedgerAbility=n.SuperAssetLedgerAbility,e.AssetLedgerCapability=n.AssetLedgerCapability,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(52))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s=r(53),u=r(54),a=r(55),h=r(56),l=r(57),c=r(58),d=r(59),f=r(60),p=r(61),v=r(62),m=r(63),y=r(64),g=r(65),w=r(66),M=r(67),_=r(68),b=r(70),A=r(71),E=r(72),x=r(73),T=r(74),N=r(75),I=r(76),P=r(77);class S{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new S(t,e)}constructor(t,e){this._id=i.normalizeAddress(e),this._provider=t}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return n(this,void 0,void 0,function*(){return t=i.normalizeAddress(t),w.default(this,t)})}getApprovedAccount(t){return n(this,void 0,void 0,function*(){return _.default(this,t)})}getAssetAccount(t){return n(this,void 0,void 0,function*(){return A.default(this,t)})}getAsset(t){return n(this,void 0,void 0,function*(){return b.default(this,t)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=i.normalizeAddress(t),x.default(this,t)})}getCapabilities(){return n(this,void 0,void 0,function*(){return T.default(this)})}getInfo(){return n(this,void 0,void 0,function*(){return N.default(this)})}getAssetIdAt(t){return n(this,void 0,void 0,function*(){return E.default(this,t)})}getAccountAssetIdAt(t,e){return n(this,void 0,void 0,function*(){return t=i.normalizeAddress(t),M.default(this,t,e)})}isApprovedAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),(e=i.normalizeAddress(e))===(yield _.default(this,t))})}isTransferable(){return n(this,void 0,void 0,function*(){return P.default(this)})}approveAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),e=i.normalizeAddress(e),s.default(this,e,t)})}disapproveAccount(t){return n(this,void 0,void 0,function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)})}grantAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0)),t=i.normalizeAddress(t);let r=i.bigNumberify(0);return e.forEach(t=>{r=r.add(t)}),l.default(this,t,r)})}createAsset(t){return n(this,void 0,void 0,function*(){const e=t.imprint||"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=i.normalizeAddress(t.receiverId);return u.default(this,r,t.id,`0x${e}`)})}destroyAsset(t){return n(this,void 0,void 0,function*(){return h.default(this,t)})}revokeAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0));let r=!1;-1!==e.indexOf(o.SuperAssetLedgerAbility.MANAGE_ABILITIES)&&(r=!0),t=i.normalizeAddress(t);let n=i.bigNumberify(0);return e.forEach(t=>{n=n.add(t)}),c.default(this,t,n,r)})}revokeAsset(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}transferAsset(t){return n(this,void 0,void 0,function*(){t.senderId||(t.senderId=this.provider.accountId);const e=i.normalizeAddress(t.senderId),r=i.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 n(this,void 0,void 0,function*(){return v.default(this,!0)})}disableTransfers(){return n(this,void 0,void 0,function*(){return v.default(this,!1)})}updateAsset(t,e){return n(this,void 0,void 0,function*(){return g.default(this,t,e.imprint)})}update(t){return n(this,void 0,void 0,function*(){return y.default(this,t.uriBase)})}approveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=i.normalizeAddress(t),p.default(this,t,!0)})}disapproveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=i.normalizeAddress(t),p.default(this,t,!1)})}isApprovedOperator(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),t=i.normalizeAddress(t),e=i.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}}e.AssetLedger=S},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x095ea7b3",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xb0e329e4",u=["address","uint256","bytes32"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(16),u=r(44),a=["string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriBase:h,schemaId:l,capabilities:c}){return n(this,void 0,void 0,function*(){const n=(yield s.fetch(t.assetLedgerSource).then(t=>t.json())).XcertMock.evm.bytecode.object,d=(c||[]).map(t=>u.getInterfaceCode(t)),f={from:t.accountId,data:`0x${n}${o.encodeParameters(a,[e,r,h,l,d]).substr(2)}`},p=yield t.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(t,p.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x9d118770",u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x0ab319e8",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xaca910e7",u=["address","uint256","bool"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x20c5429b",u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0);e.default=function(t,e,r,s,u){return n(this,void 0,void 0,function*(){const n=void 0!==u?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==u&&a.push("bytes");const h=[e,r,s,u].filter(t=>void 0!==t),l={from:t.provider.accountId,to:t.id,data:n+o.encodeParameters(a,h).substr(2)},c=yield t.provider.post({method:"eth_sendTransaction",params:[l]});return new i.Mutation(t.provider,c.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xa22cb465",u=["address","bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xbedb86fb",u=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[!e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x23b872dd",u=["address","address","uint256"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x27fc0cff",u=["string"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xbda0e852",u=["uint256","bytes32"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s="0xba00a330",u=["address","uint256"],a=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){return Promise.all([o.SuperAssetLedgerAbility.MANAGE_ABILITIES,o.GeneralAssetLedgerAbility.CREATE_ASSET,o.GeneralAssetLedgerAbility.REVOKE_ASSET,o.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,o.GeneralAssetLedgerAbility.UPDATE_ASSET,o.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,o.GeneralAssetLedgerAbility.UPDATE_URI_BASE].map(r=>n(this,void 0,void 0,function*(){const n={to:t.id,data:s+i.encodeParameters(u,[e,r]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(a,o.result)[0]?r:-1}))).then(t=>t.filter(t=>-1!==t).sort((t,e)=>t-e)).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x2f745c59",s=["address","uint256"],u=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:o+i.encodeParameters(s,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(u,a.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(69),s="0x081812fc",u=["uint256"],a=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:s+i.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(a,n.result)[0]}catch(r){return o.default(t,e)}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x481af3d3",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x70c31afc",inputTypes:["uint256"],outputTypes:["bytes32"]}];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=yield Promise.all(o.map(r=>n(this,void 0,void 0,function*(){try{const n={to:t.id,data:r.signature+i.encodeParameters(r.inputTypes,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(r.outputTypes,o.result)[0]}catch(t){return null}})));return{id:e,uri:r[0],imprint:r[1]?r[1].substr(2):r[1]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x6352211e",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x4f6ccce7",s=["uint256"],u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x70a08231",s=["address"],u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s=r(44),u="0x01ffc9a7",a=["bytes8"],h=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){return Promise.all([o.AssetLedgerCapability.DESTROY_ASSET,o.AssetLedgerCapability.REVOKE_ASSET,o.AssetLedgerCapability.TOGGLE_TRANSFERS,o.AssetLedgerCapability.UPDATE_ASSET].map(e=>n(this,void 0,void 0,function*(){const r=s.getInterfaceCode(e),n={to:t.id,data:u+i.encodeParameters(a,[r]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(h,o.result)[0]?e:-1}))).then(t=>t.filter(t=>-1!==t).sort()).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0xfbca0ce1",inputTypes:[],outputTypes:["string"]},{signature:"0x075b1a09",inputTypes:[],outputTypes:["bytes32"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return n(this,void 0,void 0,function*(){const e=yield Promise.all(o.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+i.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],uriBase:e[2],schemaId:e[3],supply:e[4]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xe985e9c5",s=["address","address"],u=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:o+i.encodeParameters(s,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(u,a.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xb187bd26",s=[],u=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){try{const e={to:t.id,data:o+i.encodeParameters(s,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!i.decodeParameters(u,r.result)[0]}catch(t){return null}})}},,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(51))}]); \ No newline at end of file +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],c=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},l=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},d=function(t,e){var r=c(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,c=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,c,l,d,f,p,v,m,y,g,w,M,_,b,A,E,x,T,N,I,P,S,O,R,L,k,C,j,U,G,D,B,F,z,V,Z,q,$,H,K,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(h<<1|c>>>31),r=o^(c<<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=s^(l<<1|d>>>31),r=a^(d<<1|l>>>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=c^(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=l^(i<<1|o>>>31),r=d^(o<<1|i>>>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],m=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,N=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,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&M,t[10]=x^~N&P,t[11]=T^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&W,t[31]=$^~K&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=N^~P&O,t[13]=I^~S&R,t[22]=U^~D&F,t[23]=G^~B&z,t[32]=H^~W&X,t[33]=K^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&A,t[5]=M^~b&E,t[14]=P^~O&L,t[15]=S^~R&k,t[24]=D^~F&V,t[25]=B^~z&Z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=O^~L&x,t[17]=R^~k&T,t[26]=F^~V&C,t[27]=z^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~ct&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&N,t[19]=k^~T&I,t[28]=V^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(m=0;m1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.getInterfaceCode=function(t){return t==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==n.AssetLedgerCapability.UPDATE_ASSET?"0xbda0e852":t==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.GeneralAssetLedgerAbility=n.GeneralAssetLedgerAbility,e.SuperAssetLedgerAbility=n.SuperAssetLedgerAbility,e.AssetLedgerCapability=n.AssetLedgerCapability,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(49))},,function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(50),u=r(51),a=r(52),h=r(53),c=r(54),l=r(55),d=r(56),f=r(57),p=r(58),v=r(59),m=r(60),y=r(61),g=r(62),w=r(63),M=r(64),_=r(65),b=r(67),A=r(68),E=r(69),x=r(70),T=r(71),N=r(72),I=r(73),P=r(74);e.AssetLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),w.default(this,t)})}getApprovedAccount(t){return n(this,void 0,void 0,function*(){return _.default(this,t)})}getAssetAccount(t){return n(this,void 0,void 0,function*(){return A.default(this,t)})}getAsset(t){return n(this,void 0,void 0,function*(){return b.default(this,t)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),x.default(this,t)})}getCapabilities(){return n(this,void 0,void 0,function*(){return T.default(this)})}getInfo(){return n(this,void 0,void 0,function*(){return N.default(this)})}getAssetIdAt(t){return n(this,void 0,void 0,function*(){return E.default(this,t)})}getAccountAssetIdAt(t,e){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),M.default(this,t,e)})}isApprovedAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),(e=this._provider.encoder.normalizeAddress(e))===(yield _.default(this,t))})}isTransferable(){return n(this,void 0,void 0,function*(){return P.default(this)})}approveAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)})}disapproveAccount(t){return n(this,void 0,void 0,function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)})}grantAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0)),t=this._provider.encoder.normalizeAddress(t);let r=i.bigNumberify(0);return e.forEach(t=>{r=r.add(t)}),c.default(this,t,r)})}createAsset(t){return n(this,void 0,void 0,function*(){const e=t.imprint||"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=this._provider.encoder.normalizeAddress(t.receiverId);return u.default(this,r,t.id,`0x${e}`)})}destroyAsset(t){return n(this,void 0,void 0,function*(){return h.default(this,t)})}revokeAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0));let r=!1;-1!==e.indexOf(o.SuperAssetLedgerAbility.MANAGE_ABILITIES)&&(r=!0),t=this._provider.encoder.normalizeAddress(t);let n=i.bigNumberify(0);return e.forEach(t=>{n=n.add(t)}),l.default(this,t,n,r)})}revokeAsset(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}transferAsset(t){return n(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 n(this,void 0,void 0,function*(){return v.default(this,!0)})}disableTransfers(){return n(this,void 0,void 0,function*(){return v.default(this,!1)})}updateAsset(t,e){return n(this,void 0,void 0,function*(){return g.default(this,t,e.imprint)})}update(t){return n(this,void 0,void 0,function*(){return y.default(this,t.uriBase)})}approveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!0)})}disapproveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!1)})}isApprovedOperator(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xb0e329e4",s=["address","uint256","bytes32"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=r(45),u=["string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriBase:a,schemaId:h,capabilities:c}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.assetLedgerSource).then(t=>t.json())).XcertMock.evm.bytecode.object,l=(c||[]).map(t=>s.getInterfaceCode(t)),d={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(u,[e,r,a,h,l]).substr(2)}`},f=yield t.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(t,f.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x9d118770",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x0ab319e8",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xaca910e7",s=["address","uint256","bool"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x20c5429b",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0);e.default=function(t,e,r,o,s){return n(this,void 0,void 0,function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",u=["address","address","uint256"];void 0!==s&&u.push("bytes");const a=[e,r,o,s].filter(t=>void 0!==t),h={from:t.provider.accountId,to:t.id,data:n+t.provider.encoder.encodeParameters(u,a).substr(2)},c=yield t.provider.post({method:"eth_sendTransaction",params:[h]});return new i.Mutation(t.provider,c.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa22cb465",s=["address","bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbedb86fb",s=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[!e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x27fc0cff",s=["string"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbda0e852",s=["uint256","bytes32"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o="0xba00a330",s=["address","uint256"],u=["bool"];e.default=function(t,e){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].map(r=>n(this,void 0,void 0,function*(){const n={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]?r:-1}))).then(t=>t.filter(t=>-1!==t).sort((t,e)=>t-e)).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x2f745c59",o=["address","uint256"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(66),o="0x081812fc",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(r){return i.default(t,e)}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x481af3d3",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x70c31afc",inputTypes:["uint256"],outputTypes:["bytes32"]}];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=yield Promise.all(i.map(r=>n(this,void 0,void 0,function*(){try{const n={to:t.id,data:r.signature+t.provider.encoder.encodeParameters(r.inputTypes,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(r.outputTypes,i.result)[0]}catch(t){return null}})));return{id:e,uri:r[0],imprint:r[1]?r[1].substr(2):r[1]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x6352211e",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x4f6ccce7",o=["uint256"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o=r(45),s="0x01ffc9a7",u=["bytes8"],a=["bool"];e.default=function(t){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(e=>n(this,void 0,void 0,function*(){const r=o.getInterfaceCode(e),n={to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(a,i.result)[0]?e:-1}))).then(t=>t.filter(t=>-1!==t).sort()).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0xfbca0ce1",inputTypes:[],outputTypes:["string"]},{signature:"0x075b1a09",inputTypes:[],outputTypes:["bytes32"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],uriBase:e[2],schemaId:e[3],supply:e[4]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xe985e9c5",o=["address","address"],s=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xb187bd26",o=[],s=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){try{const e={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return null}})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(47))}]); \ 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 87a6e5443..c099efa90 100644 --- a/dist/0xcert-ethereum-http-provider.min.js +++ b/dist/0xcert-ethereum-http-provider.min.js @@ -1,4 +1,4 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=98)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(30)),n(r(11)),n(r(41))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(6)),n(r(5)),n(r(12)),n(r(42)),n(r(43)),n(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5)),n(r(29)),n(r(6)),n(r(17))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(2),s=r(34),u=r(38),a=r(4);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],O=8191&x,S=x>>>13,R=0|s[7],P=8191&R,L=R>>>13,k=0|s[8],C=8191&k,U=k>>>13,j=0|s[9],G=8191&j,D=j>>>13,B=0|u[0],F=8191&B,V=B>>>13,Z=0|u[1],z=8191&Z,q=Z>>>13,$=0|u[2],H=8191&$,K=$>>>13,J=0|u[3],W=8191&J,X=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var wt=(h+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,V))+Math.imul(S,F)|0,o=Math.imul(S,V),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(U,F)|0,o=Math.imul(U,V),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,z),i=(i=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(U,H)|0,o=o+Math.imul(U,K)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,W),i=(i=Math.imul(G,X))+Math.imul(D,W)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var Ot=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,ft)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,ft)|0;var Rt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=Ot,a[14]=St,a[15]=Rt,a[16]=Pt,a[17]=Lt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(8)),a=r(2),h=r(10),l=r(39),c=s(r(4)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(20)),n(r(22)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(19)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(21).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(23);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,O,S,R,P,L,k,C,U,j,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,j=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&O,t[11]=T^~x&S,t[20]=C^~j&D,t[21]=U^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~O&R,t[13]=x^~S&P,t[22]=j^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&T,t[26]=F^~Z&C,t[27]=V^~z&U,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&I,t[19]=k^~T&x,t[28]=Z^~C&j,t[29]=z^~U&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(7),u=r(9),a=r(2),h=r(40),l=r(10),c=o(r(4)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");j(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new U(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new U(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new U(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(2);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=105)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");j(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new U(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new U(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new U(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],O=8191&x,S=x>>>13,R=0|s[7],P=8191&R,L=R>>>13,k=0|s[8],C=8191&k,U=k>>>13,j=0|s[9],G=8191&j,D=j>>>13,B=0|u[0],F=8191&B,V=B>>>13,Z=0|u[1],z=8191&Z,q=Z>>>13,$=0|u[2],H=8191&$,K=$>>>13,J=0|u[3],W=8191&J,X=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var wt=(h+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,V))+Math.imul(S,F)|0,o=Math.imul(S,V),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(U,F)|0,o=Math.imul(U,V),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,z),i=(i=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(U,H)|0,o=o+Math.imul(U,K)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(U,W)|0,o=o+Math.imul(U,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,W),i=(i=Math.imul(G,X))+Math.imul(D,W)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var Ot=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,ft)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,ft)|0;var Rt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=Ot,a[14]=St,a[15]=Rt,a[16]=Pt,a[17]=Lt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,O,S,R,P,L,k,C,U,j,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,j=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&O,t[11]=T^~x&S,t[20]=C^~j&D,t[21]=U^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~O&R,t[13]=x^~S&P,t[22]=j^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&T,t[26]=F^~Z&C,t[27]=V^~z&U,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&I,t[19]=k^~T&x,t[28]=Z^~C&j,t[29]=z^~U&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -7,4 +7,4 @@ * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,O,S,R,P,L,k,C,U,j,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,j=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&O,t[11]=T^~x&S,t[20]=C^~j&D,t[21]=U^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~O&R,t[13]=x^~S&P,t[22]=j^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&T,t[26]=F^~Z&C,t[27]=V^~z&U,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&I,t[19]=k^~T&x,t[28]=Z^~C&j,t[29]=z^~U&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),o=r(3),s=r(13);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedi.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=i.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>i.normalizeAddress(t))})}getNetworkVersion(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===i.normalizeAddress(t)}isUnsafeRecipientId(t){const e=i.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(99))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(1)),n(r(100))},function(t,e,r){"use strict";var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);it.json()).then(t=>e(null,t)).catch(t=>e(t,null))}}e.HttpProvider=s}]); \ No newline at end of file +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,O,S,R,P,L,k,C,U,j,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,j=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&O,t[11]=T^~x&S,t[20]=C^~j&D,t[21]=U^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~O&R,t[13]=x^~S&P,t[22]=j^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&T,t[26]=F^~Z&C,t[27]=V^~z&U,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&I,t[19]=k^~T&x,t[28]=Z^~C&j,t[29]=z^~U&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(106))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(0)),n(r(107))},function(t,e,r){"use strict";var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);it.json()).then(t=>e(null,t)).catch(t=>e(t,null))}}}]); \ 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 d3f1c47b2..a4638f916 100644 --- a/dist/0xcert-ethereum-metamask-provider.min.js +++ b/dist/0xcert-ethereum-metamask-provider.min.js @@ -1,4 +1,4 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=101)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(30)),n(r(11)),n(r(41))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(6)),n(r(5)),n(r(12)),n(r(42)),n(r(43)),n(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5)),n(r(29)),n(r(6)),n(r(17))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(2),s=r(34),u=r(38),a=r(4);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],S=8191&x,R=x>>>13,O=0|s[7],L=8191&O,P=O>>>13,k=0|s[8],C=8191&k,U=k>>>13,j=0|s[9],G=8191&j,D=j>>>13,B=0|u[0],F=8191&B,V=B>>>13,Z=0|u[1],z=8191&Z,q=Z>>>13,H=0|u[2],K=8191&H,$=H>>>13,W=0|u[3],J=8191&W,X=W>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var gt=(h+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,V))+Math.imul(y,F)|0,o=Math.imul(y,V),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;var yt=(h+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(f,K)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(g,z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(R,F)|0,o=Math.imul(R,V),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,V))+Math.imul(P,F)|0,o=Math.imul(P,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(U,F)|0,o=Math.imul(U,V),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,q)|0,n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,z),i=(i=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,$)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,$))+Math.imul(D,K)|0,o=Math.imul(D,$),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(U,J)|0,o=o+Math.imul(U,X)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,J),i=(i=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,nt)|0,n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var St=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(P,at)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ft)|0;var Rt=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ft)|0;var Ot=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,ft)|0;var Lt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Pt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=gt,a[2]=yt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=St,a[14]=Rt,a[15]=Ot,a[16]=Lt,a[17]=Pt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(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(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.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 n=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(8)),a=r(2),h=r(10),l=r(39),c=s(r(4)),f=new u.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 p(t){return g(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return g(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function g(t){return t instanceof v?t:new v(t)}e.bigNumberify=g,e.ConstantNegativeOne=g(-1),e.ConstantZero=g(0),e.ConstantOne=g(1),e.ConstantTwo=g(2),e.ConstantWeiPerEther=g("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(7),u=r(9),a=r(2),h=r(40),l=r(10),c=o(r(4)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function g(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function y(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");j(i[2]).forEach(function(t){e.outputs.push(y(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new U(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?y(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new U(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?y(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new U(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(2);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=108)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function g(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function y(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");j(i[2]).forEach(function(t){e.outputs.push(y(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new U(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?y(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new U(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?y(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new U(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],g=8191&v,y=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],S=8191&x,R=x>>>13,O=0|s[7],L=8191&O,P=O>>>13,k=0|s[8],C=8191&k,U=k>>>13,j=0|s[9],G=8191&j,D=j>>>13,B=0|u[0],F=8191&B,V=B>>>13,Z=0|u[1],z=8191&Z,q=Z>>>13,H=0|u[2],K=8191&H,$=H>>>13,W=0|u[3],J=8191&W,X=W>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var gt=(h+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(g,F),i=(i=Math.imul(g,V))+Math.imul(y,F)|0,o=Math.imul(y,V),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;var yt=(h+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,$)|0)+Math.imul(f,K)|0))<<13)|0;h=((o=o+Math.imul(f,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(g,z)|0,i=(i=i+Math.imul(g,q)|0)+Math.imul(y,z)|0,o=o+Math.imul(y,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,$)|0;var wt=(h+(n=n+Math.imul(c,J)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,J)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(g,K)|0,i=(i=i+Math.imul(g,$)|0)+Math.imul(y,K)|0,o=o+Math.imul(y,$)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,$)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,$)|0,n=n+Math.imul(g,J)|0,i=(i=i+Math.imul(g,X)|0)+Math.imul(y,J)|0,o=o+Math.imul(y,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(R,F)|0,o=Math.imul(R,V),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,$)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,$)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(g,Q)|0,i=(i=i+Math.imul(g,tt)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(L,F),i=(i=Math.imul(L,V))+Math.imul(P,F)|0,o=Math.imul(P,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,$)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,$)|0,n=n+Math.imul(E,J)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,J)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(g,rt)|0,i=(i=i+Math.imul(g,nt)|0)+Math.imul(y,rt)|0,o=o+Math.imul(y,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(U,F)|0,o=Math.imul(U,V),n=n+Math.imul(L,z)|0,i=(i=i+Math.imul(L,q)|0)+Math.imul(P,z)|0,o=o+Math.imul(P,q)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,$)|0)+Math.imul(R,K)|0,o=o+Math.imul(R,$)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(g,ot)|0,i=(i=i+Math.imul(g,st)|0)+Math.imul(y,ot)|0,o=o+Math.imul(y,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(U,z)|0,o=o+Math.imul(U,q)|0,n=n+Math.imul(L,K)|0,i=(i=i+Math.imul(L,$)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,$)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(R,J)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(g,at)|0,i=(i=i+Math.imul(g,ht)|0)+Math.imul(y,at)|0,o=o+Math.imul(y,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,z),i=(i=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,$)|0)+Math.imul(U,K)|0,o=o+Math.imul(U,$)|0,n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,X)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(g,ct)|0,i=(i=i+Math.imul(g,ft)|0)+Math.imul(y,ct)|0,o=o+Math.imul(y,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,$))+Math.imul(D,K)|0,o=Math.imul(D,$),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(U,J)|0,o=o+Math.imul(U,X)|0,n=n+Math.imul(L,Q)|0,i=(i=i+Math.imul(L,tt)|0)+Math.imul(P,Q)|0,o=o+Math.imul(P,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(g,pt)|0)|0)+((8191&(i=(i=i+Math.imul(g,mt)|0)+Math.imul(y,pt)|0))<<13)|0;h=((o=o+Math.imul(y,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,J),i=(i=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(U,Q)|0,o=o+Math.imul(U,tt)|0,n=n+Math.imul(L,rt)|0,i=(i=i+Math.imul(L,nt)|0)+Math.imul(P,rt)|0,o=o+Math.imul(P,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(U,rt)|0,o=o+Math.imul(U,nt)|0,n=n+Math.imul(L,ot)|0,i=(i=i+Math.imul(L,st)|0)+Math.imul(P,ot)|0,o=o+Math.imul(P,st)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var St=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(U,ot)|0,o=o+Math.imul(U,st)|0,n=n+Math.imul(L,at)|0,i=(i=i+Math.imul(L,ht)|0)+Math.imul(P,at)|0,o=o+Math.imul(P,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ft)|0;var Rt=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(U,at)|0,o=o+Math.imul(U,ht)|0,n=n+Math.imul(L,ct)|0,i=(i=i+Math.imul(L,ft)|0)+Math.imul(P,ct)|0,o=o+Math.imul(P,ft)|0;var Ot=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(U,ct)|0,o=o+Math.imul(U,ft)|0;var Lt=(h+(n=n+Math.imul(L,pt)|0)|0)+((8191&(i=(i=i+Math.imul(L,mt)|0)+Math.imul(P,pt)|0))<<13)|0;h=((o=o+Math.imul(P,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Pt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(U,pt)|0))<<13)|0;h=((o=o+Math.imul(U,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=gt,a[2]=yt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=St,a[14]=Rt,a[15]=Ot,a[16]=Lt,a[17]=Pt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function g(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(){g.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){g.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){g.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){g.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}g.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},g.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 n=e0?r.isub(this.p):r.strip(),r},g.prototype.split=function(t,e){t.iushrn(this.n,0,e)},g.prototype.imulK=function(t){return t.imul(this.k)},i(y,g),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new y;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return g(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return g(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function g(t){return t instanceof v?t:new v(t)}e.bigNumberify=g,e.ConstantNegativeOne=g(-1),e.ConstantZero=g(0),e.ConstantOne=g(1),e.ConstantTwo=g(2),e.ConstantWeiPerEther=g("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -7,4 +7,4 @@ * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,g,y,w,M,_,b,E,A,N,T,I,x,S,R,O,L,P,k,C,U,j,G,D,B,F,V,Z,z,q,H,K,$,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,L=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,j=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,H=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~g&w,t[1]=v^~y&M,t[10]=N^~I&S,t[11]=T^~x&R,t[20]=C^~j&D,t[21]=U^~G&B,t[30]=q^~K&W,t[31]=H^~$&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=g^~w&_,t[3]=y^~M&b,t[12]=I^~S&O,t[13]=x^~R&L,t[22]=j^~D&F,t[23]=G^~B&V,t[32]=K^~W&X,t[33]=$^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~O&P,t[15]=R^~L&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=O^~P&N,t[17]=L^~k&T,t[26]=F^~Z&C,t[27]=V^~z&U,t[36]=X^~Q&q,t[37]=Y^~tt&H,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&g,t[9]=A^~v&y,t[18]=P^~N&I,t[19]=k^~T&x,t[28]=Z^~C&j,t[29]=z^~U&G,t[38]=Q^~q&K,t[39]=tt^~H&$,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),o=r(3),s=r(13);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedi.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=i.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>i.normalizeAddress(t))})}getNetworkVersion(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===i.normalizeAddress(t)}isUnsafeRecipientId(t){const e=i.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(102))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(1)),n(r(103))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1);class o extends i.GenericProvider{static getInstance(){return new o}constructor(t){super(Object.assign({},t,{signMethod:i.SignMethod.PERSONAL_SIGN})),this.isSupported()&&(this.installClient(),this.installEvents())}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 n(this,void 0,void 0,function*(){return!(!this.isSupported()||!this.accountId)&&(void 0!==window.ethereum?this._client._metamask.isApproved():void 0!==window.web3)})}enable(){return n(this,void 0,void 0,function*(){return!!this.isSupported()&&(this.accountId=void 0!==window.ethereum?yield this._client.enable().then(t=>t[0]):window.web3.eth.coinbase,this)})}installClient(){return n(this,void 0,void 0,function*(){void 0!==window.ethereum?this._client=window.ethereum:this._client=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 n(this,void 0,void 0,function*(){const t=yield this.getNetworkVersion();t!==this._networkVersion&&(this.emit(i.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}]); \ No newline at end of file +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,g,y,w,M,_,b,E,A,N,T,I,x,S,R,O,L,P,k,C,U,j,G,D,B,F,V,Z,z,q,H,K,$,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,$=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,U=t[3]<<1|t[2]>>>31,g=t[13]<<12|t[12]>>>20,y=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,L=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,j=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,P=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,H=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~g&w,t[1]=v^~y&M,t[10]=N^~I&S,t[11]=T^~x&R,t[20]=C^~j&D,t[21]=U^~G&B,t[30]=q^~K&W,t[31]=H^~$&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=g^~w&_,t[3]=y^~M&b,t[12]=I^~S&O,t[13]=x^~R&L,t[22]=j^~D&F,t[23]=G^~B&V,t[32]=K^~W&X,t[33]=$^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~O&P,t[15]=R^~L&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=O^~P&N,t[17]=L^~k&T,t[26]=F^~Z&C,t[27]=V^~z&U,t[36]=X^~Q&q,t[37]=Y^~tt&H,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&g,t[9]=A^~v&y,t[18]=P^~N&I,t[19]=k^~T&x,t[28]=Z^~C&j,t[29]=z^~U&G,t[38]=Q^~q&K,t[39]=tt^~H&$,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(109))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(0)),n(r(110))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0);e.MetamaskProvider=class extends i.GenericProvider{static getInstance(){return new this}constructor(t){super(Object.assign({},t,{signMethod:i.SignMethod.PERSONAL_SIGN})),this.isSupported()&&(this.installClient(),this.installEvents())}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 n(this,void 0,void 0,function*(){return!(!this.isSupported()||!this.accountId)&&(void 0!==window.ethereum?this._client._metamask.isApproved():void 0!==window.web3)})}enable(){return n(this,void 0,void 0,function*(){return!!this.isSupported()&&(this.accountId=void 0!==window.ethereum?yield this._client.enable().then(t=>t[0]):window.web3.eth.coinbase,this)})}installClient(){return n(this,void 0,void 0,function*(){void 0!==window.ethereum?this._client=window.ethereum:this._client=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 n(this,void 0,void 0,function*(){const t=yield this.getNetworkVersion();t!==this._networkVersion&&(this.emit(i.ProviderEvent.NETWORK_CHANGE,t,this._networkVersion),this._networkVersion=t),this.accountId=yield this.getAvailableAccounts().then(t=>t[0]),setTimeout(()=>this.installEvents(),1e3)})}}}]); \ No newline at end of file diff --git a/dist/0xcert-ethereum-order-gateway.min.js b/dist/0xcert-ethereum-order-gateway.min.js index cca843e72..a133d0a4e 100644 --- a/dist/0xcert-ethereum-order-gateway.min.js +++ b/dist/0xcert-ethereum-order-gateway.min.js @@ -1,4 +1,4 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=104)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(30)),n(r(11)),n(r(41))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(6)),n(r(5)),n(r(12)),n(r(42)),n(r(43)),n(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5)),n(r(29)),n(r(6)),n(r(17))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(2),s=r(34),u=r(38),a=r(4);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],S=8191&x,O=x>>>13,R=0|s[7],P=8191&R,k=R>>>13,L=0|s[8],C=8191&L,j=L>>>13,U=0|s[9],G=8191&U,F=U>>>13,D=0|u[0],B=8191&D,V=D>>>13,z=0|u[1],Z=8191&z,q=z>>>13,$=0|u[2],K=8191&$,H=$>>>13,J=0|u[3],X=8191&J,W=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,B))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,V))+Math.imul(m,B)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,Z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),i=(i=Math.imul(y,V))+Math.imul(g,B)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,K)|0))<<13)|0;h=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,V))+Math.imul(_,B)|0,o=Math.imul(_,V),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,H)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(f,X)|0))<<13)|0;h=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,V))+Math.imul(A,B)|0,o=Math.imul(A,V),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,W)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,B),i=(i=Math.imul(T,V))+Math.imul(I,B)|0,o=Math.imul(I,V),n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,B),i=(i=Math.imul(S,V))+Math.imul(O,B)|0,o=Math.imul(O,V),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,B),i=(i=Math.imul(P,V))+Math.imul(k,B)|0,o=Math.imul(k,V),n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,V))+Math.imul(j,B)|0,o=Math.imul(j,V),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,B),i=(i=Math.imul(G,V))+Math.imul(F,B)|0,o=Math.imul(F,V),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(F,Z)|0,o=Math.imul(F,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,H)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,H))+Math.imul(F,K)|0,o=Math.imul(F,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,X),i=(i=Math.imul(G,W))+Math.imul(F,X)|0,o=Math.imul(F,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,at)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var St=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(k,at)|0,o=o+Math.imul(k,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ft)|0;var Ot=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ft)|0;var Rt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(F,at)|0,o=Math.imul(F,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(F,ct)|0,o=Math.imul(F,ft);var kt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(F,pt)|0))<<13)|0;return h=((o=Math.imul(F,mt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=St,a[14]=Ot,a[15]=Rt,a[16]=Pt,a[17]=kt,a[18]=Lt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(8)),a=r(2),h=r(10),l=r(39),c=s(r(4)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),o=r(3),s=r(16),u=r(45);function a(t){return t.kind==o.OrderActionKind.CREATE_ASSET?"00":"01"}function h(t,e){return e.kind==o.OrderActionKind.TRANSFER_VALUE?u.OrderGatewayProxy.TOKEN_TRANSFER:e.kind==o.OrderActionKind.TRANSFER_ASSET?-1===t.provider.unsafeRecipientIds.indexOf(e.ledgerId)?u.OrderGatewayProxy.NFTOKEN_SAFE_TRANSFER:u.OrderGatewayProxy.NFTOKEN_TRANSFER:u.OrderGatewayProxy.XCERT_CREATE}function l(t){return t.kind==o.OrderActionKind.CREATE_ASSET?d(`0x${t.assetImprint}`,64):`${t.senderId}000000000000000000000000`}function c(t){return p(i.bigNumberify(t.assetId||t.value).toHexString(),64,"0",!0)}function f(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")}function p(t,e,r,n){const i=void 0===n?/^0x/i.test(t)||"number"==typeof t:n,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+t}e.createOrderHash=function(t,e){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of e.actions)r=s.keccak256(f(["0x",r.substr(2),a(n),`0000000${h(t,n)}`,n.ledgerId.substr(2),l(n).substr(2),n.receiverId.substr(2),c(n).substr(2)].join("")));return s.keccak256(f(["0x",t.id.substr(2),e.makerId.substr(2),e.takerId.substr(2),r.substr(2),p(s.toInteger(e.seed),64,"0",!1),p(s.toSeconds(e.expiration),64,"0",!1)].join("")))},e.createRecipeTuple=function(t,e){const r=e.actions.map(e=>({kind:a(e),proxy:h(t,e),token:e.ledgerId,param1:l(e),to:e.receiverId,value:c(e)})),n={from:e.makerId,to:e.takerId,actions:r,seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(n)},e.createSignatureTuple=function(t){const[e,r]=t.split(":"),i=parseInt(e)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:e,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)},e.getActionKind=a,e.getActionProxy=h,e.getActionParam1=l,e.getActionValue=c,e.hexToBytes=f,e.rightPad=d,e.leftPad=p,e.normalizeOrderIds=function(t){return(t=JSON.parse(JSON.stringify(t))).makerId=i.normalizeAddress(t.makerId),t.takerId=i.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=i.normalizeAddress(t.ledgerId),t.receiverId=i.normalizeAddress(t.receiverId),t.senderId=i.normalizeAddress(t.senderId)}),t}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(20)),n(r(22)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(19)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(21).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(23);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,S,O,R,P,k,L,C,j,U,G,F,D,B,V,z,Z,q,$,K,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,B=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&S,t[11]=T^~x&O,t[20]=C^~U&F,t[21]=j^~G&D,t[30]=q^~K&J,t[31]=$^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~S&R,t[13]=x^~O&P,t[22]=U^~F&B,t[23]=G^~D&V,t[32]=K^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~R&k,t[15]=O^~P&L,t[24]=F^~B&z,t[25]=D^~V&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~k&N,t[17]=P^~L&T,t[26]=B^~z&C,t[27]=V^~Z&j,t[36]=W^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=k^~N&I,t[19]=L^~T&x,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&K,t[39]=tt^~$&H,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(7),u=r(9),a=r(2),h=r(40),l=r(10),c=o(r(4)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,F(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(F(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var D=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(F(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(F(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=D,e.defaultAbiCoder=new D},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(2);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=111)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,F(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(F(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var D=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(F(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(F(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=D,e.defaultAbiCoder=new D},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],S=8191&x,O=x>>>13,R=0|s[7],P=8191&R,k=R>>>13,L=0|s[8],C=8191&L,j=L>>>13,U=0|s[9],G=8191&U,F=U>>>13,D=0|u[0],B=8191&D,V=D>>>13,z=0|u[1],Z=8191&z,q=z>>>13,$=0|u[2],K=8191&$,H=$>>>13,J=0|u[3],X=8191&J,W=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,B))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,V))+Math.imul(m,B)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,Z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),i=(i=Math.imul(y,V))+Math.imul(g,B)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,K)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,K)|0))<<13)|0;h=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,V))+Math.imul(_,B)|0,o=Math.imul(_,V),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,H)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(f,X)|0))<<13)|0;h=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,V))+Math.imul(A,B)|0,o=Math.imul(A,V),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,K)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,W)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,B),i=(i=Math.imul(T,V))+Math.imul(I,B)|0,o=Math.imul(I,V),n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,K)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(_,K)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,B),i=(i=Math.imul(S,V))+Math.imul(O,B)|0,o=Math.imul(O,V),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,Z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,K)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,B),i=(i=Math.imul(P,V))+Math.imul(k,B)|0,o=Math.imul(k,V),n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,q)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,V))+Math.imul(j,B)|0,o=Math.imul(j,V),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(S,K)|0,i=(i=i+Math.imul(S,H)|0)+Math.imul(O,K)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,B),i=(i=Math.imul(G,V))+Math.imul(F,B)|0,o=Math.imul(F,V),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,K)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(F,Z)|0,o=Math.imul(F,q),n=n+Math.imul(C,K)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(j,K)|0,o=o+Math.imul(j,H)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,K),i=(i=Math.imul(G,H))+Math.imul(F,K)|0,o=Math.imul(F,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,X),i=(i=Math.imul(G,W))+Math.imul(F,X)|0,o=Math.imul(F,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(O,at)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var St=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(k,at)|0,o=o+Math.imul(k,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(O,ct)|0,o=o+Math.imul(O,ft)|0;var Ot=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ft)|0;var Rt=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(F,at)|0,o=Math.imul(F,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(F,ct)|0,o=Math.imul(F,ft);var kt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(F,pt)|0))<<13)|0;return h=((o=Math.imul(F,mt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=St,a[14]=Ot,a[15]=Rt,a[16]=Pt,a[17]=kt,a[18]=Lt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(5),o=r(2),s=r(17),u=r(46);function a(t){return t.kind==o.OrderActionKind.CREATE_ASSET?"00":"01"}function h(t,e){return e.kind==o.OrderActionKind.TRANSFER_VALUE?u.OrderGatewayProxy.TOKEN_TRANSFER:e.kind==o.OrderActionKind.TRANSFER_ASSET?-1===t.provider.unsafeRecipientIds.indexOf(e.ledgerId)?u.OrderGatewayProxy.NFTOKEN_SAFE_TRANSFER:u.OrderGatewayProxy.NFTOKEN_TRANSFER:u.OrderGatewayProxy.XCERT_CREATE}function l(t){return t.kind==o.OrderActionKind.CREATE_ASSET?d(`0x${t.assetImprint}`,64):`${t.senderId}000000000000000000000000`}function c(t){return p(i.bigNumberify(t.assetId||t.value).toHexString(),64,"0",!0)}function f(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")}function p(t,e,r,n){const i=void 0===n?/^0x/i.test(t)||"number"==typeof t:n,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+t}e.createOrderHash=function(t,e){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of e.actions)r=s.keccak256(f(["0x",r.substr(2),a(n),`0000000${h(t,n)}`,n.ledgerId.substr(2),l(n).substr(2),n.receiverId.substr(2),c(n).substr(2)].join("")));return s.keccak256(f(["0x",t.id.substr(2),e.makerId.substr(2),e.takerId.substr(2),r.substr(2),p(s.toInteger(e.seed),64,"0",!1),p(s.toSeconds(e.expiration),64,"0",!1)].join("")))},e.createRecipeTuple=function(t,e){const r=e.actions.map(e=>({kind:a(e),proxy:h(t,e),token:e.ledgerId,param1:l(e),to:e.receiverId,value:c(e)})),n={from:e.makerId,to:e.takerId,actions:r,seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(n)},e.createSignatureTuple=function(t){const[e,r]=t.split(":"),i=parseInt(e)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:e,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)},e.getActionKind=a,e.getActionProxy=h,e.getActionParam1=l,e.getActionValue=c,e.hexToBytes=f,e.rightPad=d,e.leftPad=p,e.normalizeOrderIds=function(t,e){return(t=JSON.parse(JSON.stringify(t))).makerId=e.encoder.normalizeAddress(t.makerId),t.takerId=e.encoder.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=e.encoder.normalizeAddress(t.ledgerId),t.receiverId=e.encoder.normalizeAddress(t.receiverId),t.senderId=e.encoder.normalizeAddress(t.senderId)}),t}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,S,O,R,P,k,L,C,j,U,G,F,D,B,V,z,Z,q,$,K,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,B=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&S,t[11]=T^~x&O,t[20]=C^~U&F,t[21]=j^~G&D,t[30]=q^~K&J,t[31]=$^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~S&R,t[13]=x^~O&P,t[22]=U^~F&B,t[23]=G^~D&V,t[32]=K^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~R&k,t[15]=O^~P&L,t[24]=F^~B&z,t[25]=D^~V&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~k&N,t[17]=P^~L&T,t[26]=B^~z&C,t[27]=V^~Z&j,t[36]=W^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=k^~N&I,t[19]=L^~T&x,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&K,t[39]=tt^~$&H,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -7,4 +7,4 @@ * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,S,O,R,P,k,L,C,j,U,G,F,D,B,V,z,Z,q,$,K,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,B=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&S,t[11]=T^~x&O,t[20]=C^~U&F,t[21]=j^~G&D,t[30]=q^~K&J,t[31]=$^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~S&R,t[13]=x^~O&P,t[22]=U^~F&B,t[23]=G^~D&V,t[32]=K^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~R&k,t[15]=O^~P&L,t[24]=F^~B&z,t[25]=D^~V&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~k&N,t[17]=P^~L&T,t[26]=B^~z&C,t[27]=V^~Z&j,t[36]=W^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=k^~N&I,t[19]=L^~T&x,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&K,t[39]=tt^~$&H,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),o=r(3),s=r(13);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedi.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=i.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>i.normalizeAddress(t))})}getNetworkVersion(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===i.normalizeAddress(t)}isUnsafeRecipientId(t){const e=i.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.XCERT_CREATE=0]="XCERT_CREATE",t[t.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",t[t.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",t[t.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER"}(e.OrderGatewayProxy||(e.OrderGatewayProxy={}))},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(17)),n(r(79)),n(r(45))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(15),u=r(80),a=r(81),h=r(82),l=r(83),c=r(84),f=r(85),d=r(86);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=o.normalizeAddress(e||t.orderGatewayId),this._provider=t}get id(){return this._id}get provider(){return this._provider}claim(t){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?l.default(this,t):h.default(this,t)})}perform(t,e){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),u.default(this,t)})}getProxyAccountId(t){return n(this,void 0,void 0,function*(){return f.default(this,t)})}isValidSignature(t,e){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),d.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),c.default(this,t)})}}e.OrderGateway=p},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(15),u="0x36d63aca",a=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=s.createRecipeTuple(t,e),n={from:t.provider.accountId,to:t.id,data:u+o.encodeParameters(a,[r]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(15),u="0x8b1d8335",a=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=s.createRecipeTuple(t,e),h=s.createSignatureTuple(r),l={from:t.provider.accountId,to:t.id,data:u+o.encodeParameters(a,[n,h]).substr(2)},c=yield t.provider.post({method:"eth_sendTransaction",params:[l]});return new i.Mutation(t.provider,c.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(15);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"eth_sign",params:[t.provider.accountId,r]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(15);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"personal_sign",params:[r,t.provider.accountId,null]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(15),s="0xd1c87f30",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"],a=["bytes32"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=o.createRecipeTuple(t,e);try{const e={to:t.id,data:s+i.encodeParameters(u,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return i.decodeParameters(a,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xabd90f85",s=["uint8"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(15),s="0x8fa76d8d",u=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],a=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=o.createOrderHash(t,e),h=o.createSignatureTuple(r);try{const r={to:t.id,data:s+i.encodeParameters(u,[e.makerId,n,h]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(a,o.result)[0]}catch(t){return null}})}},,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(78))}]); \ No newline at end of file +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,S,O,R,P,k,L,C,j,U,G,F,D,B,V,z,Z,q,$,K,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],K=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=t[19]<<20|t[18]>>>12,ot=t[29]<<7|t[28]>>>25,st=t[28]<<7|t[29]>>>25,B=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&S,t[11]=T^~x&O,t[20]=C^~U&F,t[21]=j^~G&D,t[30]=q^~K&J,t[31]=$^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~S&R,t[13]=x^~O&P,t[22]=U^~F&B,t[23]=G^~D&V,t[32]=K^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~R&k,t[15]=O^~P&L,t[24]=F^~B&z,t[25]=D^~V&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~k&N,t[17]=P^~L&T,t[26]=B^~z&C,t[27]=V^~Z&j,t[36]=W^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=k^~N&I,t[19]=L^~T&x,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&K,t[39]=tt^~$&H,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.XCERT_CREATE=0]="XCERT_CREATE",t[t.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",t[t.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",t[t.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER"}(e.OrderGatewayProxy||(e.OrderGatewayProxy={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(75)),n(r(46))},,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s=r(76),u=r(77),a=r(78),h=r(79),l=r(80),c=r(81),f=r(82);e.OrderGateway=class{static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e||t.orderGatewayId)}get id(){return this._id}get provider(){return this._provider}claim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?h.default(this,t):a.default(this,t)})}perform(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),u.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),s.default(this,t)})}getProxyAccountId(t){return n(this,void 0,void 0,function*(){return c.default(this,t)})}isValidSignature(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),l.default(this,t)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x36d63aca",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=o.createRecipeTuple(t,e),n={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x8b1d8335",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=o.createRecipeTuple(t,e),a=o.createSignatureTuple(r),h={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[n,a]).substr(2)},l=yield t.provider.post({method:"eth_sendTransaction",params:[h]});return new i.Mutation(t.provider,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"eth_sign",params:[t.provider.accountId,r]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"personal_sign",params:[r,t.provider.accountId,null]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0xd1c87f30",s=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"],u=["bytes32"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createRecipeTuple(t,e);try{const e={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xabd90f85",o=["uint8"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0x8fa76d8d",s=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],u=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=i.createOrderHash(t,e),a=i.createSignatureTuple(r);try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e.makerId,n,a]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]}catch(t){return null}})}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(48))}]); \ 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 890421545..215d90377 100644 --- a/dist/0xcert-ethereum-value-ledger.min.js +++ b/dist/0xcert-ethereum-value-ledger.min.js @@ -1,4 +1,4 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=105)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(30)),n(r(11)),n(r(41))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(6)),n(r(5)),n(r(12)),n(r(42)),n(r(43)),n(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5)),n(r(29)),n(r(6)),n(r(17))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(2),s=r(34),u=r(38),a=r(4);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],x=8191&N,T=N>>>13,I=0|s[6],S=8191&I,R=I>>>13,O=0|s[7],P=8191&O,L=O>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,V=B>>>13,Z=0|u[1],z=8191&Z,q=Z>>>13,$=0|u[2],H=8191&$,K=$>>>13,J=0|u[3],W=8191&J,X=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var wt=(h+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(R,F)|0,o=Math.imul(R,V),n=n+Math.imul(x,z)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(T,z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(S,z)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(R,z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,z),i=(i=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var xt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var Tt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,W),i=(i=Math.imul(G,X))+Math.imul(D,W)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ft)|0;var St=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ft)|0;var Rt=(h+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,ft)|0;var Ot=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=xt,a[11]=Tt,a[12]=It,a[13]=St,a[14]=Rt,a[15]=Ot,a[16]=Pt,a[17]=Lt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(8)),a=r(2),h=r(10),l=r(39),c=s(r(4)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(20)),n(r(22)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(19)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(21).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(23);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,x,T,I,S,R,O,P,L,k,C,j,U,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,O=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,T=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~T&S,t[11]=x^~I&R,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=T^~S&O,t[13]=I^~R&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~O&L,t[15]=R^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=O^~L&N,t[17]=P^~k&x,t[26]=F^~Z&C,t[27]=V^~z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&T,t[19]=k^~x&I,t[28]=Z^~C&U,t[29]=z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(7),u=r(9),a=r(2),h=r(40),l=r(10),c=o(r(4)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new x(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(2);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=112)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new x(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],x=8191&N,T=N>>>13,I=0|s[6],S=8191&I,R=I>>>13,O=0|s[7],P=8191&O,L=O>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,V=B>>>13,z=0|u[1],Z=8191&z,q=z>>>13,$=0|u[2],H=8191&$,K=$>>>13,J=0|u[3],W=8191&J,X=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,Z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var wt=(h+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(S,F),i=(i=Math.imul(S,V))+Math.imul(R,F)|0,o=Math.imul(R,V),n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,q)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,q)|0,n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul(R,H)|0,o=o+Math.imul(R,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(R,W)|0,o=o+Math.imul(R,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(D,Z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,tt)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var xt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(S,rt)|0,i=(i=i+Math.imul(S,nt)|0)+Math.imul(R,rt)|0,o=o+Math.imul(R,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var Tt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,W),i=(i=Math.imul(G,X))+Math.imul(D,W)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(S,ot)|0,i=(i=i+Math.imul(S,st)|0)+Math.imul(R,ot)|0,o=o+Math.imul(R,st)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(S,at)|0,i=(i=i+Math.imul(S,ht)|0)+Math.imul(R,at)|0,o=o+Math.imul(R,ht)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ft)|0;var St=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(S,ct)|0,i=(i=i+Math.imul(S,ft)|0)+Math.imul(R,ct)|0,o=o+Math.imul(R,ft)|0;var Rt=(h+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,ft)|0;var Ot=(h+(n=n+Math.imul(S,pt)|0)|0)+((8191&(i=(i=i+Math.imul(S,mt)|0)+Math.imul(R,pt)|0))<<13)|0;h=((o=o+Math.imul(R,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=xt,a[11]=Tt,a[12]=It,a[13]=St,a[14]=Rt,a[15]=Ot,a[16]=Pt,a[17]=Lt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,x,T,I,S,R,O,P,L,k,C,j,U,G,D,B,F,V,z,Z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,O=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,T=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~T&S,t[11]=x^~I&R,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=T^~S&O,t[13]=I^~R&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~O&L,t[15]=R^~P&k,t[24]=D^~F&z,t[25]=B^~V&Z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=O^~L&N,t[17]=P^~k&x,t[26]=F^~z&C,t[27]=V^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&T,t[19]=k^~x&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -7,4 +7,4 @@ * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,x,T,I,S,R,O,P,L,k,C,j,U,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,O=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,T=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~T&S,t[11]=x^~I&R,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=T^~S&O,t[13]=I^~R&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~O&L,t[15]=R^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=O^~L&N,t[17]=P^~k&x,t[26]=F^~Z&C,t[27]=V^~z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&T,t[19]=k^~x&I,t[28]=Z^~C&U,t[29]=z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),o=r(3),s=r(13);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedi.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=i.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>i.normalizeAddress(t))})}getNetworkVersion(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===i.normalizeAddress(t)}isUnsafeRecipientId(t){const e=i.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(88))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s=r(89),u=r(90),a=r(91),h=r(92),l=r(93),c=r(94),f=r(95);class d{static deploy(t,e){return n(this,void 0,void 0,function*(){return u.default(t,e)})}static getInstance(t,e){return new d(t,e)}constructor(t,e){this._id=i.normalizeAddress(e),this._provider=t}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),t=i.normalizeAddress(t),e=i.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=i.normalizeAddress(t),c.default(this,t)})}getInfo(){return n(this,void 0,void 0,function*(){return f.default(this)})}isApprovedValue(t,e,r){return n(this,void 0,void 0,function*(){"string"!=typeof r&&(r=yield r.getProxyAccountId(1)),e=i.normalizeAddress(e),r=i.normalizeAddress(r);const n=yield l.default(this,e,r);return i.bigNumberify(n).gte(i.bigNumberify(t))})}approveValue(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),e=i.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!i.bigNumberify(t).isZero()&&!i.bigNumberify(r).isZero())throw new o.ProviderError(o.ProviderIssue.GENERAL,"First set approval to 0. ERC20 token potential attack.");return s.default(this,e,t)})}disapproveValue(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(1)),t=i.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=i.normalizeAddress(t.senderId),r=i.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}}e.ValueLedger=d},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x095ea7b3",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(16),u=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:a,supply:h}){return n(this,void 0,void 0,function*(){const n=(yield s.fetch(t.valueLedgerSource).then(t=>t.json())).TokenMock.evm.bytecode.object,l={from:t.accountId,data:`0x${n}${o.encodeParameters(u,[e,r,a,h]).substr(2)}`},c=yield t.post({method:"eth_sendTransaction",params:[l]});return new i.Mutation(t,c.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xa9059cbb",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x23b872dd",u=["address","address","uint256"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xdd62ed3e",s=["address","address"],u=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:o+i.encodeParameters(s,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(u,a.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x70a08231",s=["address"],u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=[{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 n(this,void 0,void 0,function*(){const e=yield Promise.all(o.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+i.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}})}},,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(87))}]); \ No newline at end of file +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,x,T,I,S,R,O,P,L,k,C,j,U,G,D,B,F,V,z,Z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,S=t[20]<<3|t[21]>>>29,R=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,O=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,T=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~T&S,t[11]=x^~I&R,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=T^~S&O,t[13]=I^~R&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=S^~O&L,t[15]=R^~P&k,t[24]=D^~F&z,t[25]=B^~V&Z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=O^~L&N,t[17]=P^~k&x,t[26]=F^~z&C,t[27]=V^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&T,t[19]=k^~x&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(84))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(85),u=r(86),a=r(87),h=r(88),l=r(89),c=r(90),f=r(91);e.ValueLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return u.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t)})}getInfo(){return n(this,void 0,void 0,function*(){return f.default(this)})}isApprovedValue(t,e,r){return n(this,void 0,void 0,function*(){"string"!=typeof r&&(r=yield r.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const n=yield l.default(this,e,r);return i.bigNumberify(n).gte(i.bigNumberify(t))})}approveValue(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!i.bigNumberify(t).isZero()&&!i.bigNumberify(r).isZero())throw new o.ProviderError(o.ProviderIssue.GENERAL,"First set approval to 0. ERC20 token potential attack.");return s.default(this,e,t)})}disapproveValue(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:u,supply:a}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.valueLedgerSource).then(t=>t.json())).TokenMock.evm.bytecode.object,h={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(s,[e,r,u,a]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[h]});return new i.Mutation(t,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa9059cbb",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xdd62ed3e",o=["address","address"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.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 n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}})}},,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(83))}]); \ No newline at end of file diff --git a/dist/0xcert-ethereum.min.js b/dist/0xcert-ethereum.min.js index 67fe3a214..dd838eb0f 100644 --- a/dist/0xcert-ethereum.min.js +++ b/dist/0xcert-ethereum.min.js @@ -1,4 +1,4 @@ -!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=106)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(30)),n(r(11)),n(r(41))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(6)),n(r(5)),n(r(12)),n(r(42)),n(r(43)),n(r(14))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(4);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+c[15&a])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(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 f(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=d(t.r,32),o=d(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,e+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=d,e.splitSignature=f,e.joinSignature=function(t){return l(a([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(5)),n(r(29)),n(r(6)),n(r(17))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(8)),o=r(2),s=r(34),u=r(38),a=r(4);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(l=0;l<26;l++)c[String.fromCharCode(65+l)]=String(10+l);var d,f=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/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+=c[t]});e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function v(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new i.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(u.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,l=67108863&a,d=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=d;f++){var p=h-f|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[f])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,a=0|c}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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}n(!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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),c=this.clone();if(a){for(u=0;!c.isZero();u++)s=c.andln(255),c.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,m=0|s[2],y=8191&m,g=m>>>13,w=0|s[3],_=8191&w,M=w>>>13,b=0|s[4],A=8191&b,E=b>>>13,x=0|s[5],P=8191&x,T=x>>>13,I=0|s[6],N=8191&I,O=I>>>13,S=0|s[7],R=8191&S,k=S>>>13,L=0|s[8],j=8191&L,C=L>>>13,U=0|s[9],G=8191&U,D=U>>>13,F=0|u[0],B=8191&F,z=F>>>13,V=0|u[1],Z=8191&V,$=V>>>13,K=0|u[2],q=8191&K,H=K>>>13,J=0|u[3],X=8191&J,W=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,ct=0|u[8],lt=8191&ct,dt=ct>>>13,ft=0|u[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(l,B))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,B)|0))<<13)|0;h=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(v,B)|0,o=Math.imul(v,z);var yt=(h+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,$)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),i=(i=Math.imul(y,z))+Math.imul(g,B)|0,o=Math.imul(g,z),n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0;var gt=(h+(n=n+Math.imul(l,q)|0)|0)+((8191&(i=(i=i+Math.imul(l,H)|0)+Math.imul(d,q)|0))<<13)|0;h=((o=o+Math.imul(d,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,B),i=(i=Math.imul(_,z))+Math.imul(M,B)|0,o=Math.imul(M,z),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var wt=(h+(n=n+Math.imul(l,X)|0)|0)+((8191&(i=(i=i+Math.imul(l,W)|0)+Math.imul(d,X)|0))<<13)|0;h=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,B),i=(i=Math.imul(A,z))+Math.imul(E,B)|0,o=Math.imul(E,z),n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,W)|0;var _t=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,B),i=(i=Math.imul(P,z))+Math.imul(T,B)|0,o=Math.imul(T,z),n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(_,q)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var Mt=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,B),i=(i=Math.imul(N,z))+Math.imul(O,B)|0,o=Math.imul(O,z),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var bt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,B),i=(i=Math.imul(R,z))+Math.imul(k,B)|0,o=Math.imul(k,z),n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(h+(n=n+Math.imul(l,at)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(d,at)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,z))+Math.imul(C,B)|0,o=Math.imul(C,z),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ht)|0;var Et=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(G,B),i=(i=Math.imul(G,z))+Math.imul(D,B)|0,o=Math.imul(D,z),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,vt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,$))+Math.imul(D,Z)|0,o=Math.imul(D,$),n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ht)|0)+Math.imul(M,at)|0,o=o+Math.imul(M,ht)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Pt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,q),i=(i=Math.imul(G,H))+Math.imul(D,q)|0,o=Math.imul(D,H),n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,at)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(_,lt)|0,i=(i=i+Math.imul(_,dt)|0)+Math.imul(M,lt)|0,o=o+Math.imul(M,dt)|0;var Tt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,X),i=(i=Math.imul(G,W))+Math.imul(D,X)|0,o=Math.imul(D,W),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,dt)|0;var It=(h+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(M,pt)|0))<<13)|0;h=((o=o+Math.imul(M,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(N,at)|0,i=(i=i+Math.imul(N,ht)|0)+Math.imul(O,at)|0,o=o+Math.imul(O,ht)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(T,lt)|0,o=o+Math.imul(T,dt)|0;var Nt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(k,at)|0,o=o+Math.imul(k,ht)|0,n=n+Math.imul(N,lt)|0,i=(i=i+Math.imul(N,dt)|0)+Math.imul(O,lt)|0,o=o+Math.imul(O,dt)|0;var Ot=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(j,at)|0,i=(i=i+Math.imul(j,ht)|0)+Math.imul(C,at)|0,o=o+Math.imul(C,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(k,lt)|0,o=o+Math.imul(k,dt)|0;var St=(h+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,vt)|0)+Math.imul(O,pt)|0))<<13)|0;h=((o=o+Math.imul(O,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(j,lt)|0,i=(i=i+Math.imul(j,dt)|0)+Math.imul(C,lt)|0,o=o+Math.imul(C,dt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,lt),i=(i=Math.imul(G,dt))+Math.imul(D,lt)|0,o=Math.imul(D,dt);var kt=(h+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,vt)|0)+Math.imul(C,pt)|0))<<13)|0;h=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,vt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,vt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=mt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=_t,a[5]=Mt,a[6]=bt,a[7]=At,a[8]=Et,a[9]=xt,a[10]=Pt,a[11]=Tt,a[12]=It,a[13]=Nt,a[14]=Ot,a[15]=St,a[16]=Rt,a[17]=kt,a[18]=Lt,0!==h&&(a[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=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n: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,n=0;n>=1;return n},v.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&u}return a&&0!==c&&(a.words[a.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(l)),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;)(u.isOdd()||a.isOdd())&&(u.iadd(c),a.isub(l)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(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 y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}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 g;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return m[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(a);)c.redIAdd(a);for(var l=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(u);){for(var v=f,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var h=e.words[n],c=a-1;c>=0;c--){var l=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++u||0===n&&0===c)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,b),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(8)),a=r(2),h=r(10),c=r(39),l=s(r(4)),d=new u.default.BN(-1);function f(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 p(t){return y(t)._bn}function v(t){return new m(f(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(l.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))):l.throwError("invalid BigNumber string value",l.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&l.throwError("underflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",f(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",f(new u.default.BN(a.hexlify(r).substring(2),16))):l.throwError("invalid BigNumber value",l.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(d):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return v(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return v(this._bn.toTwos(t))},e.prototype.add=function(t){return v(this._bn.add(p(t)))},e.prototype.sub=function(t){return v(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&l.throwError("division by zero",l.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),v(this._bn.div(p(t)))},e.prototype.mul=function(t){return v(this._bn.mul(p(t)))},e.prototype.mod=function(t){return v(this._bn.mod(p(t)))},e.prototype.pow=function(t){return v(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return v(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(c.BigNumber);function y(t){return t instanceof m?t:new m(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(7);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,c=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return d(this,t,!0)},u.prototype.rawListeners=function(t){return d(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(1),i=r(0),o=r(3),s=r(16),u=r(45);function a(t){return t.kind==o.OrderActionKind.CREATE_ASSET?"00":"01"}function h(t,e){return e.kind==o.OrderActionKind.TRANSFER_VALUE?u.OrderGatewayProxy.TOKEN_TRANSFER:e.kind==o.OrderActionKind.TRANSFER_ASSET?-1===t.provider.unsafeRecipientIds.indexOf(e.ledgerId)?u.OrderGatewayProxy.NFTOKEN_SAFE_TRANSFER:u.OrderGatewayProxy.NFTOKEN_TRANSFER:u.OrderGatewayProxy.XCERT_CREATE}function c(t){return t.kind==o.OrderActionKind.CREATE_ASSET?f(`0x${t.assetImprint}`,64):`${t.senderId}000000000000000000000000`}function l(t){return p(i.bigNumberify(t.assetId||t.value).toHexString(),64,"0",!0)}function d(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")}function p(t,e,r,n){const i=void 0===n?/^0x/i.test(t)||"number"==typeof t:n,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+t}e.createOrderHash=function(t,e){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of e.actions)r=s.keccak256(d(["0x",r.substr(2),a(n),`0000000${h(t,n)}`,n.ledgerId.substr(2),c(n).substr(2),n.receiverId.substr(2),l(n).substr(2)].join("")));return s.keccak256(d(["0x",t.id.substr(2),e.makerId.substr(2),e.takerId.substr(2),r.substr(2),p(s.toInteger(e.seed),64,"0",!1),p(s.toSeconds(e.expiration),64,"0",!1)].join("")))},e.createRecipeTuple=function(t,e){const r=e.actions.map(e=>({kind:a(e),proxy:h(t,e),token:e.ledgerId,param1:c(e),to:e.receiverId,value:l(e)})),n={from:e.makerId,to:e.takerId,actions:r,seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(n)},e.createSignatureTuple=function(t){const[e,r]=t.split(":"),i=parseInt(e)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:e,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)},e.getActionKind=a,e.getActionProxy=h,e.getActionParam1=c,e.getActionValue=l,e.hexToBytes=d,e.rightPad=f,e.leftPad=p,e.normalizeOrderIds=function(t){return(t=JSON.parse(JSON.stringify(t))).makerId=i.normalizeAddress(t.makerId),t.takerId=i.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=i.normalizeAddress(t.ledgerId),t.receiverId=i.normalizeAddress(t.receiverId),t.senderId=i.normalizeAddress(t.senderId)}),t}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(20)),n(r(22)),n(r(24)),n(r(25)),n(r(26)),n(r(27)),n(r(28))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(19)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(21).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(23);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,c,l,d,f,p,v,m,y,g,w,_,M,b,A,E,x,P,T,I,N,O,S,R,k,L,j,C,U,G,D,F,B,z,V,Z,$,K,q,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(h<<1|c>>>31),r=s^(c<<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=u^(l<<1|d>>>31),r=a^(d<<1|l>>>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=c^(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=l^(i<<1|s>>>31),r=d^(s<<1|i>>>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],m=t[1],q=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,j=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,$=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,T=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,B=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&_,t[10]=x^~T&N,t[11]=P^~I&O,t[20]=j^~U&D,t[21]=C^~G&F,t[30]=$^~q&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&M,t[3]=g^~_&b,t[12]=T^~N&S,t[13]=I^~O&R,t[22]=U^~D&B,t[23]=G^~F&z,t[32]=q^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~M&A,t[5]=_^~b&E,t[14]=N^~S&k,t[15]=O^~R&L,t[24]=D^~B&V,t[25]=F^~z&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=M^~A&v,t[7]=b^~E&m,t[16]=S^~k&x,t[17]=R^~L&P,t[26]=B^~V&j,t[27]=z^~Z&C,t[36]=W^~Q&$,t[37]=Y^~tt&K,t[46]=ut^~ht&et,t[47]=at^~ct&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=k^~x&T,t[19]=L^~P&I,t[28]=V^~j&U,t[29]=Z^~C&G,t[38]=Q^~$&q,t[39]=tt^~K&H,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,c=t.blockCount,l=t.outputBlocks,d=t.s,f=0;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=m-h,t.block=a[c],m=0;m>2]|=n[3&m],t.lastByteIndex===h)for(a[0]=a[c],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%c==0&&(s(d),m=0)}return"0x"+v})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(31).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(7),u=r(9),a=r(2),h=r(40),c=r(10),l=o(r(4)),d=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(f);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var _=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),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 i(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}(_),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(_),A=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){l.throwError("invalid number value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){l.throwError("invalid "+this.name+" value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||l.throwError("expected array value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),l.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&l.throwError("invalid "+r[1]+" bit length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[1]))||i>32)&&l.throwError("invalid bytes length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new P(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=c.jsonCopy(e)).type=r[1],new j(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new C(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){l.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&l.throwError("types/values length mismatch",l.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new C(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):c.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new C(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(2);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=121)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+h[15&a])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function l(t,e){for(c(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 f(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=l(t.r,32),o=l(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=d(a.slice(0,32)),o=d(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=d,e.hexDataLength=function(t){return c(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return c(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,e+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(c(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=l,e.splitSignature=f,e.joinSignature=function(t){return d(a([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function c(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var h={},d=0;d<10;d++)h[String(d)]=String(d);for(d=0;d<26;d++)h[String.fromCharCode(65+d)]=String(10+d);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 n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function v(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=c(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=c("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new i.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(u.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),c=r(40),h=r(11),d=o(r(3)),l=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(f);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var _=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),M=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return h.defineReadOnly(r,"coder",e),r}return i(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}(_),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(_),A=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){d.throwError("invalid number value",d.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){d.throwError("invalid "+this.name+" value",d.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||d.throwError("expected array value",d.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),d.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&d.throwError("invalid "+r[1]+" bit length",d.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(l))return(0===(i=parseInt(r[1]))||i>32)&&d.throwError("invalid bytes length",d.INVALID_ARGUMENT,{arg:"param",value:e}),new P(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=h.jsonCopy(e)).type=r[1],new j(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new C(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(d.throwError("invalid type",d.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){d.checkNew(this,t),r||(r=e.defaultCoerceFunc),h.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&d.throwError("types/values length mismatch",d.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new C(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):h.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new C(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,c=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 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],d=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var c=1;c>>26,d=67108863&a,l=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=l;f++){var p=c-f|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,a=0|h}return 0!==a?r.words[c]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 l=h[t],f=d[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:c[l-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,c=new t(o),h=this.clone();if(a){for(u=0;!h.isZero();u++)s=h.andln(255),h.iushrn(8),c[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,m=0|s[2],y=8191&m,g=m>>>13,w=0|s[3],_=8191&w,M=w>>>13,b=0|s[4],A=8191&b,E=b>>>13,x=0|s[5],P=8191&x,T=x>>>13,I=0|s[6],N=8191&I,O=I>>>13,S=0|s[7],R=8191&S,k=S>>>13,L=0|s[8],j=8191&L,C=L>>>13,U=0|s[9],G=8191&U,D=U>>>13,F=0|u[0],B=8191&F,z=F>>>13,V=0|u[1],Z=8191&V,$=V>>>13,K=0|u[2],q=8191&K,H=K>>>13,J=0|u[3],X=8191&J,W=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ct=ut>>>13,ht=0|u[8],dt=8191&ht,lt=ht>>>13,ft=0|u[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(d,B))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(l,B)|0))<<13)|0;c=((o=Math.imul(l,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(v,B)|0,o=Math.imul(v,z);var yt=(c+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(l,Z)|0))<<13)|0;c=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),i=(i=Math.imul(y,z))+Math.imul(g,B)|0,o=Math.imul(g,z),n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0;var gt=(c+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(l,q)|0))<<13)|0;c=((o=o+Math.imul(l,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,B),i=(i=Math.imul(_,z))+Math.imul(M,B)|0,o=Math.imul(M,z),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var wt=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(l,X)|0))<<13)|0;c=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,B),i=(i=Math.imul(A,z))+Math.imul(E,B)|0,o=Math.imul(E,z),n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,$)|0,n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,W)|0;var _t=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(l,Q)|0))<<13)|0;c=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,B),i=(i=Math.imul(P,z))+Math.imul(T,B)|0,o=Math.imul(T,z),n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(_,q)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var Mt=(c+(n=n+Math.imul(d,rt)|0)|0)+((8191&(i=(i=i+Math.imul(d,nt)|0)+Math.imul(l,rt)|0))<<13)|0;c=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(N,B),i=(i=Math.imul(N,z))+Math.imul(O,B)|0,o=Math.imul(O,z),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(M,X)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var bt=(c+(n=n+Math.imul(d,ot)|0)|0)+((8191&(i=(i=i+Math.imul(d,st)|0)+Math.imul(l,ot)|0))<<13)|0;c=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,B),i=(i=Math.imul(R,z))+Math.imul(k,B)|0,o=Math.imul(k,z),n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,$)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,$)|0,n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(c+(n=n+Math.imul(d,at)|0)|0)+((8191&(i=(i=i+Math.imul(d,ct)|0)+Math.imul(l,at)|0))<<13)|0;c=((o=o+Math.imul(l,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(j,B),i=(i=Math.imul(j,z))+Math.imul(C,B)|0,o=Math.imul(C,z),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,$)|0,n=n+Math.imul(N,q)|0,i=(i=i+Math.imul(N,H)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,H)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(M,rt)|0,o=o+Math.imul(M,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ct)|0;var Et=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,lt)|0)+Math.imul(l,dt)|0))<<13)|0;c=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(G,B),i=(i=Math.imul(G,z))+Math.imul(D,B)|0,o=Math.imul(D,z),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,$)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(k,q)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(O,X)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(M,ot)|0,o=o+Math.imul(M,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ct)|0,n=n+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,lt)|0;var xt=(c+(n=n+Math.imul(d,pt)|0)|0)+((8191&(i=(i=i+Math.imul(d,vt)|0)+Math.imul(l,pt)|0))<<13)|0;c=((o=o+Math.imul(l,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,$))+Math.imul(D,Z)|0,o=Math.imul(D,$),n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,H)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(N,Q)|0,i=(i=i+Math.imul(N,tt)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(M,at)|0,o=o+Math.imul(M,ct)|0,n=n+Math.imul(y,dt)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(g,dt)|0,o=o+Math.imul(g,lt)|0;var Pt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,q),i=(i=Math.imul(G,H))+Math.imul(D,q)|0,o=Math.imul(D,H),n=n+Math.imul(j,X)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(N,rt)|0,i=(i=i+Math.imul(N,nt)|0)+Math.imul(O,rt)|0,o=o+Math.imul(O,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,at)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(M,dt)|0,o=o+Math.imul(M,lt)|0;var Tt=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,X),i=(i=Math.imul(G,W))+Math.imul(D,X)|0,o=Math.imul(D,W),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(N,ot)|0,i=(i=i+Math.imul(N,st)|0)+Math.imul(O,ot)|0,o=o+Math.imul(O,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(A,dt)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(E,dt)|0,o=o+Math.imul(E,lt)|0;var It=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(M,pt)|0))<<13)|0;c=((o=o+Math.imul(M,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(j,rt)|0,i=(i=i+Math.imul(j,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(N,at)|0,i=(i=i+Math.imul(N,ct)|0)+Math.imul(O,at)|0,o=o+Math.imul(O,ct)|0,n=n+Math.imul(P,dt)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,lt)|0;var Nt=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(j,ot)|0,i=(i=i+Math.imul(j,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(k,at)|0,o=o+Math.imul(k,ct)|0,n=n+Math.imul(N,dt)|0,i=(i=i+Math.imul(N,lt)|0)+Math.imul(O,dt)|0,o=o+Math.imul(O,lt)|0;var Ot=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(j,at)|0,i=(i=i+Math.imul(j,ct)|0)+Math.imul(C,at)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(R,dt)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(k,dt)|0,o=o+Math.imul(k,lt)|0;var St=(c+(n=n+Math.imul(N,pt)|0)|0)+((8191&(i=(i=i+Math.imul(N,vt)|0)+Math.imul(O,pt)|0))<<13)|0;c=((o=o+Math.imul(O,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ct))+Math.imul(D,at)|0,o=Math.imul(D,ct),n=n+Math.imul(j,dt)|0,i=(i=i+Math.imul(j,lt)|0)+Math.imul(C,dt)|0,o=o+Math.imul(C,lt)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(k,pt)|0))<<13)|0;c=((o=o+Math.imul(k,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,dt),i=(i=Math.imul(G,lt))+Math.imul(D,dt)|0,o=Math.imul(D,lt);var kt=(c+(n=n+Math.imul(j,pt)|0)|0)+((8191&(i=(i=i+Math.imul(j,vt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(c+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,vt))+Math.imul(D,pt)|0))<<13)|0;return c=((o=Math.imul(D,vt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=mt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=_t,a[5]=Mt,a[6]=bt,a[7]=At,a[8]=Et,a[9]=xt,a[10]=Pt,a[11]=Tt,a[12]=It,a[13]=Nt,a[14]=Ot,a[15]=St,a[16]=Rt,a[17]=kt,a[18]=Lt,0!==c&&(a[19]=c,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=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n: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,n=0;n>=1;return n},v.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==h||c>=i);c--){var d=0|this.words[c];this.words[c]=h<<26-o|d>>>o,h=d&u}return a&&0!==h&&(a.words[a.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var c=0;c=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);u&&(u.words[d]=l)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),d=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;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(d)),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;)(u.isOdd()||a.isOdd())&&(u.iadd(h),a.isub(d)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(e.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(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 y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}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 g;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new M}return m[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(a);)h.redIAdd(a);for(var d=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(u);){for(var v=f,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var c=e.words[n],h=a-1;h>=0;h--){var d=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++u||0===n&&0===h)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,b),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),c=r(11),h=r(39),d=s(r(3)),l=new u.default.BN(-1);function f(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 p(t){return y(t)._bn}function v(t){return new m(f(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(d.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),c.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?c.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),c.defineReadOnly(n,"_hex",f(new u.default.BN(r)))):d.throwError("invalid BigNumber string value",d.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&d.throwError("underflow",d.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{c.defineReadOnly(n,"_hex",f(new u.default.BN(r)))}catch(t){d.throwError("overflow",d.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?c.defineReadOnly(n,"_hex",r._hex):r.toHexString?c.defineReadOnly(n,"_hex",f(p(r.toHexString()))):a.isArrayish(r)?c.defineReadOnly(n,"_hex",f(new u.default.BN(a.hexlify(r).substring(2),16))):d.throwError("invalid BigNumber value",d.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(l):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return v(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return v(this._bn.toTwos(t))},e.prototype.add=function(t){return v(this._bn.add(p(t)))},e.prototype.sub=function(t){return v(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&d.throwError("division by zero",d.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),v(this._bn.div(p(t)))},e.prototype.mul=function(t){return v(this._bn.mul(p(t)))},e.prototype.mod=function(t){return v(this._bn.mod(p(t)))},e.prototype.pow=function(t){return v(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return v(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){d.throwError("overflow",d.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(h.BigNumber);function y(t){return t instanceof m?t:new m(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function c(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var c=a.length,h=p(a,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return l(this,t,!0)},u.prototype.rawListeners=function(t){return l(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(5),o=r(2),s=r(17),u=r(46);function a(t){return t.kind==o.OrderActionKind.CREATE_ASSET?"00":"01"}function c(t,e){return e.kind==o.OrderActionKind.TRANSFER_VALUE?u.OrderGatewayProxy.TOKEN_TRANSFER:e.kind==o.OrderActionKind.TRANSFER_ASSET?-1===t.provider.unsafeRecipientIds.indexOf(e.ledgerId)?u.OrderGatewayProxy.NFTOKEN_SAFE_TRANSFER:u.OrderGatewayProxy.NFTOKEN_TRANSFER:u.OrderGatewayProxy.XCERT_CREATE}function h(t){return t.kind==o.OrderActionKind.CREATE_ASSET?f(`0x${t.assetImprint}`,64):`${t.senderId}000000000000000000000000`}function d(t){return p(i.bigNumberify(t.assetId||t.value).toHexString(),64,"0",!0)}function l(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")}function p(t,e,r,n){const i=void 0===n?/^0x/i.test(t)||"number"==typeof t:n,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+t}e.createOrderHash=function(t,e){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of e.actions)r=s.keccak256(l(["0x",r.substr(2),a(n),`0000000${c(t,n)}`,n.ledgerId.substr(2),h(n).substr(2),n.receiverId.substr(2),d(n).substr(2)].join("")));return s.keccak256(l(["0x",t.id.substr(2),e.makerId.substr(2),e.takerId.substr(2),r.substr(2),p(s.toInteger(e.seed),64,"0",!1),p(s.toSeconds(e.expiration),64,"0",!1)].join("")))},e.createRecipeTuple=function(t,e){const r=e.actions.map(e=>({kind:a(e),proxy:c(t,e),token:e.ledgerId,param1:h(e),to:e.receiverId,value:d(e)})),n={from:e.makerId,to:e.takerId,actions:r,seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(n)},e.createSignatureTuple=function(t){const[e,r]=t.split(":"),i=parseInt(e)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:e,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)},e.getActionKind=a,e.getActionProxy=c,e.getActionParam1=h,e.getActionValue=d,e.hexToBytes=l,e.rightPad=f,e.leftPad=p,e.normalizeOrderIds=function(t,e){return(t=JSON.parse(JSON.stringify(t))).makerId=e.encoder.normalizeAddress(t.makerId),t.takerId=e.encoder.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=e.encoder.normalizeAddress(t.ledgerId),t.receiverId=e.encoder.normalizeAddress(t.receiverId),t.senderId=e.encoder.normalizeAddress(t.senderId)}),t}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,c,h,d,l,f,p,v,m,y,g,w,_,M,b,A,E,x,P,T,I,N,O,S,R,k,L,j,C,U,G,D,F,B,z,V,Z,$,K,q,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ct,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],d=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])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(c<<1|h>>>31),r=s^(h<<1|c>>>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=u^(d<<1|l>>>31),r=a^(l<<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=c^(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=d^(i<<1|s>>>31),r=l^(s<<1|i>>>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],m=t[1],q=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,j=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,$=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,T=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,B=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&_,t[10]=x^~T&N,t[11]=P^~I&O,t[20]=j^~U&D,t[21]=C^~G&F,t[30]=$^~q&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&M,t[3]=g^~_&b,t[12]=T^~N&S,t[13]=I^~O&R,t[22]=U^~D&B,t[23]=G^~F&z,t[32]=q^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~M&A,t[5]=_^~b&E,t[14]=N^~S&k,t[15]=O^~R&L,t[24]=D^~B&V,t[25]=F^~z&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ct,t[45]=st^~at&ht,t[6]=M^~A&v,t[7]=b^~E&m,t[16]=S^~k&x,t[17]=R^~L&P,t[26]=B^~V&j,t[27]=z^~Z&C,t[36]=W^~Q&$,t[37]=Y^~tt&K,t[46]=ut^~ct&et,t[47]=at^~ht&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=k^~x&T,t[19]=L^~P&I,t[28]=V^~j&U,t[29]=Z^~C&G,t[38]=Q^~$&q,t[39]=tt^~K&H,t[48]=ct^~et&nt,t[49]=ht^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,c=t.blockCount<<2,h=t.blockCount,d=t.outputBlocks,l=t.s,f=0;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(t.start=m-c,t.block=a[h],m=0;m>2]|=n[3&m],t.lastByteIndex===c)for(a[0]=a[h],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%h==0&&(s(l),m=0)}return"0x"+v})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ /** * [js-sha3]{@link https://github.com/emn178/js-sha3} * @@ -7,4 +7,4 @@ * @copyright Chen, Yi-Cyuan 2015-2016 * @license MIT */ -!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],c=function(t,e,r){return function(n){return new M(t,e,t).update(n)[r]()}},l=function(t,e,r){return function(n,i){return new M(t,e,i).update(n)[r]()}},d=function(t,e){var r=c(t,e,"hex");r.create=function(){return new M(t,e,t)},r.update=function(t){return r.create().update(t)};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}M.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,c=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,c,l,d,f,p,v,m,y,g,w,_,M,b,A,E,x,P,T,I,N,O,S,R,k,L,j,C,U,G,D,F,B,z,V,Z,$,K,q,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(h<<1|c>>>31),r=o^(c<<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=s^(l<<1|d>>>31),r=a^(d<<1|l>>>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=c^(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=l^(i<<1|o>>>31),r=d^(o<<1|i>>>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],m=t[1],q=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,j=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,$=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,T=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,B=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&_,t[10]=x^~T&N,t[11]=P^~I&O,t[20]=j^~U&D,t[21]=C^~G&F,t[30]=$^~q&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&M,t[3]=g^~_&b,t[12]=T^~N&S,t[13]=I^~O&R,t[22]=U^~D&B,t[23]=G^~F&z,t[32]=q^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~M&A,t[5]=_^~b&E,t[14]=N^~S&k,t[15]=O^~R&L,t[24]=D^~B&V,t[25]=F^~z&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=M^~A&v,t[7]=b^~E&m,t[16]=S^~k&x,t[17]=R^~L&P,t[26]=B^~V&j,t[27]=z^~Z&C,t[36]=W^~Q&$,t[37]=Y^~tt&K,t[46]=ut^~ht&et,t[47]=at^~ct&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=k^~x&T,t[19]=L^~P&I,t[28]=V^~j&U,t[29]=Z^~C&G,t[38]=Q^~$&q,t[39]=tt^~K&H,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(m=0;m1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(2);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(9);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(11),o=r(3),s=r(13);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedi.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=i.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>i.normalizeAddress(t))})}getNetworkVersion(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"net_version",params:[]})).result})}isCurrentAccount(t){return this.accountId===i.normalizeAddress(t)}isUnsafeRecipientId(t){const e=i.normalizeAddress(t);return!!this.unsafeRecipientIds.find(t=>t===e)}post(t){return n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(3);e.getInterfaceCode=function(t){return t==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==n.AssetLedgerCapability.UPDATE_ASSET?"0xbda0e852":t==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.XCERT_CREATE=0]="XCERT_CREATE",t[t.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",t[t.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",t[t.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER"}(e.OrderGatewayProxy||(e.OrderGatewayProxy={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(47))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(48),o=r(16),s=r(50);class u{static getInstance(t){return new u(t)}constructor(t){this.schema=t.schema,this.merkle=new i.Merkle(Object.assign({hasher:t=>n(this,void 0,void 0,function*(){return o.sha(256,s.toString(t))}),noncer:t=>n(this,void 0,void 0,function*(){return o.sha(256,t.join("."))})},t))}notarize(t){return n(this,void 0,void 0,function*(){const e=this.buildSchemaProps(t),r=yield this.buildCompoundProps(e);return(yield this.buildRecipes(r)).map(t=>({path:t.path,nodes:t.nodes,values:t.values}))})}expose(t,e){const r={};return e.forEach(e=>{const n=s.readPath(e,t);s.writePath(e,n,r)}),JSON.parse(JSON.stringify(r))}disclose(t,e){return n(this,void 0,void 0,function*(){const r=this.buildSchemaProps(t),n=yield this.buildCompoundProps(r);return(yield this.buildRecipes(n,e)).map(t=>({path:t.path,nodes:t.nodes,values:t.values}))})}calculate(t,e){return n(this,void 0,void 0,function*(){try{return this.checkDataInclusion(t,e)?this.imprintRecipes(e):null}catch(t){return null}})}imprint(t){return n(this,void 0,void 0,function*(){return this.notarize(t).then(t=>t[0].nodes[0].hash)})}buildSchemaProps(t,e=this.schema,r=[]){return"array"===e.type?(t||[]).map((t,n)=>this.buildSchemaProps(t,e.items,[...r,n])).reduce((t,e)=>t.concat(e),[]):"object"===e.type?Object.keys(e.properties).sort().map(n=>{const i=this.buildSchemaProps((t||{})[n],e.properties[n],[...r,n]);return-1===["object","array"].indexOf(e.properties[n].type)?[i]:i}).reduce((t,e)=>t.concat(e),[]):{path:r,value:t,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(t){return n(this,void 0,void 0,function*(){t=[...t];const e=this.buildPropGroups(t),r=Object.keys(e).sort((t,e)=>t>e?-1:1).filter(t=>""!==t);for(const n of r){const r=e[n],i=[...t.filter(t=>t.group===n)].sort((t,e)=>t.key>e.key?1:-1).map(t=>t.value),o=yield this.merkle.notarize(i,r);t.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return t.sort((t,e)=>t.key>e.key?1:-1)})}buildRecipes(t,e=null){return n(this,void 0,void 0,function*(){const r=e?s.stepPaths(e).map(t=>t.join(".")):null,i={};return t.forEach(t=>i[t.group]=t.path.slice(0,-1)),Promise.all(Object.keys(i).map(e=>n(this,void 0,void 0,function*(){const n=t.filter(t=>t.group===e).map(t=>t.value);let o=yield this.merkle.notarize(n,i[e]);if(r){const n=t.filter(t=>t.group===e).map((t,e)=>-1===r.indexOf(t.key)?-1:e).filter(t=>-1!==t);o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[e].join(".")))return{path:i[e],values:o.values,nodes:o.nodes,key:i[e].join("."),group:i[e].slice(0,-1).join(".")}}))).then(t=>t.filter(t=>!!t))})}checkDataInclusion(t,e){const r=this.buildSchemaProps(t);e=s.cloneObject(e).map(t=>Object.assign({key:t.path.join("."),group:t.path.slice(0,-1).join(".")},t));for(const n of r){const r=s.readPath(n.path,t);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=e.find(t=>t.key===i);if(!o)return!1;const u=this.getPathIndexes(n.path).pop();if(o.values.find(t=>t.index===u).value!==r)return!1}return!0}imprintRecipes(t){return n(this,void 0,void 0,function*(){if(0===t.length)return this.getEmptyImprint();t=s.cloneObject(t).map(t=>Object.assign({key:t.path.join("."),group:t.path.slice(0,-1).join(".")},t)).sort((t,e)=>t.path.length>e.path.length?-1:1);for(const e of t){const r=yield this.merkle.imprint(e).catch(()=>"");e.nodes.unshift({index:0,hash:r});const n=e.path.slice(0,-1).join("."),i=e.path.slice(0,-1),o=this.getPathIndexes(e.path).slice(-1).pop(),s=t.find(t=>t.key===n);s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const e=t.find(t=>""===t.key);return e?e.nodes.find(t=>0===t.index).hash:this.getEmptyImprint()})}getPathIndexes(t){const e=[];let r=this.schema;for(const n of t)"array"===r.type?(e.push(n),r=r.items):"object"===r.type?(e.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):e.push(void 0);return e}getEmptyImprint(){return n(this,void 0,void 0,function*(){return this.merkle.notarize([]).then(t=>t.nodes[0].hash)})}buildPropGroups(t){const e={};return t.map(t=>{const e=[];return t.path.map(t=>(e.push(t),[...e]))}).reduce((t,e)=>t.concat(e),[]).forEach(t=>e[t.slice(0,-1).join(".")]=t.slice(0,-1)),e}}e.Cert=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(49))},function(t,e,r){"use strict";var n,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.VALUE=0]="VALUE",t[t.LEAF=1]="LEAF",t[t.NODE=2]="NODE"}(n=e.MerkleHasherPosition||(e.MerkleHasherPosition={}));e.Merkle=class{constructor(t){this._options=Object.assign({hasher:t=>t,noncer:()=>""},t)}hash(t,e,r){return this._options.hasher(t,e,r)}nonce(t){return this._options.noncer(t)}notarize(t,e=[]){return i(this,void 0,void 0,function*(){const r=[...t],i=[],o=yield this._options.noncer([...e,r.length]),s=[yield this._options.hasher(o,[...e,r.length],n.NODE)];for(let t=r.length-1;t>=0;t--){const o=s[0];i.unshift(yield this._options.noncer([...e,t]));const u=yield this._options.hasher(r[t],[...e,t],n.VALUE);s.unshift(yield this._options.hasher(`${u}${i[0]}`,[...e,t],n.LEAF));const a=s[0];s.unshift(yield this._options.hasher(`${a}${o}`,[...e,t],n.NODE))}return{values:r.map((t,e)=>({index:e,value:t,nonce:i[e]})),nodes:s.map((t,e)=>({index:e,hash:t}))}})}disclose(t,e){return i(this,void 0,void 0,function*(){const r=Math.max(...e.map(t=>t+1),0),n=[],i=[t.nodes.find(t=>t.index===2*r)];for(let o=r-1;o>=0;o--)-1!==e.indexOf(o)?n.unshift(t.values.find(t=>t.index===o)):i.unshift(t.nodes.find(t=>t.index===2*o+1));return{values:n,nodes:i}})}imprint(t){return i(this,void 0,void 0,function*(){const e=[...yield Promise.all(t.values.map((t,e)=>i(this,void 0,void 0,function*(){const r=yield this._options.hasher(t.value,[e],n.VALUE);return{index:2*t.index+1,hash:yield this._options.hasher(`${r}${t.nonce}`,[e],n.LEAF),value:t.value}}))),...t.nodes];for(let t=Math.max(...e.map(t=>t.index+1),0)-1;t>=0;t-=2){const r=e.find(e=>e.index===t),i=e.find(e=>e.index===t-1);r&&i&&e.unshift({index:t-2,hash:yield this._options.hasher(`${i.hash}${r.hash}`,[t],n.NODE)})}const r=e.find(t=>0===t.index);return r?r.hash:null})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){try{return null==t?"":`${t}`}catch(t){return""}},e.cloneObject=function(t){return JSON.parse(JSON.stringify(t))},e.stepPaths=function(t){const e={"":[]};return t.forEach(t=>{const r=[];t.forEach(t=>{r.push(t),e[r.join(".")]=[...r]})}),Object.keys(e).sort().map(t=>e[t])},e.readPath=function t(e,r){try{return Array.isArray(e)?0===e.length?r:t(e.slice(1),r[e[0]]):void 0}catch(t){return}},e.writePath=function(t,e,r={}){let n=r=r||{};for(let r=0;r{r=r.add(t)}),c.default(this,t,r)})}createAsset(t){return n(this,void 0,void 0,function*(){const e=t.imprint||"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=i.normalizeAddress(t.receiverId);return u.default(this,r,t.id,`0x${e}`)})}destroyAsset(t){return n(this,void 0,void 0,function*(){return h.default(this,t)})}revokeAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0));let r=!1;-1!==e.indexOf(o.SuperAssetLedgerAbility.MANAGE_ABILITIES)&&(r=!0),t=i.normalizeAddress(t);let n=i.bigNumberify(0);return e.forEach(t=>{n=n.add(t)}),l.default(this,t,n,r)})}revokeAsset(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}transferAsset(t){return n(this,void 0,void 0,function*(){t.senderId||(t.senderId=this.provider.accountId);const e=i.normalizeAddress(t.senderId),r=i.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 n(this,void 0,void 0,function*(){return v.default(this,!0)})}disableTransfers(){return n(this,void 0,void 0,function*(){return v.default(this,!1)})}updateAsset(t,e){return n(this,void 0,void 0,function*(){return g.default(this,t,e.imprint)})}update(t){return n(this,void 0,void 0,function*(){return y.default(this,t.uriBase)})}approveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=i.normalizeAddress(t),p.default(this,t,!0)})}disapproveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=i.normalizeAddress(t),p.default(this,t,!1)})}isApprovedOperator(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),t=i.normalizeAddress(t),e=i.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}}e.AssetLedger=O},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x095ea7b3",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xb0e329e4",u=["address","uint256","bytes32"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(16),u=r(44),a=["string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriBase:h,schemaId:c,capabilities:l}){return n(this,void 0,void 0,function*(){const n=(yield s.fetch(t.assetLedgerSource).then(t=>t.json())).XcertMock.evm.bytecode.object,d=(l||[]).map(t=>u.getInterfaceCode(t)),f={from:t.accountId,data:`0x${n}${o.encodeParameters(a,[e,r,h,c,d]).substr(2)}`},p=yield t.post({method:"eth_sendTransaction",params:[f]});return new i.Mutation(t,p.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x9d118770",u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x0ab319e8",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xaca910e7",u=["address","uint256","bool"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x20c5429b",u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0);e.default=function(t,e,r,s,u){return n(this,void 0,void 0,function*(){const n=void 0!==u?"0xb88d4fde":"0x42842e0e",a=["address","address","uint256"];void 0!==u&&a.push("bytes");const h=[e,r,s,u].filter(t=>void 0!==t),c={from:t.provider.accountId,to:t.id,data:n+o.encodeParameters(a,h).substr(2)},l=yield t.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t.provider,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xa22cb465",u=["address","bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xbedb86fb",u=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[!e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x23b872dd",u=["address","address","uint256"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x27fc0cff",u=["string"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xbda0e852",u=["uint256","bytes32"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s="0xba00a330",u=["address","uint256"],a=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){return Promise.all([o.SuperAssetLedgerAbility.MANAGE_ABILITIES,o.GeneralAssetLedgerAbility.CREATE_ASSET,o.GeneralAssetLedgerAbility.REVOKE_ASSET,o.GeneralAssetLedgerAbility.TOGGLE_TRANSFERS,o.GeneralAssetLedgerAbility.UPDATE_ASSET,o.GeneralAssetLedgerAbility.ALLOW_CREATE_ASSET,o.GeneralAssetLedgerAbility.UPDATE_URI_BASE].map(r=>n(this,void 0,void 0,function*(){const n={to:t.id,data:s+i.encodeParameters(u,[e,r]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(a,o.result)[0]?r:-1}))).then(t=>t.filter(t=>-1!==t).sort((t,e)=>t-e)).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x2f745c59",s=["address","uint256"],u=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:o+i.encodeParameters(s,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(u,a.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(69),s="0x081812fc",u=["uint256"],a=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:s+i.encodeParameters(u,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(a,n.result)[0]}catch(r){return o.default(t,e)}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x481af3d3",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x70c31afc",inputTypes:["uint256"],outputTypes:["bytes32"]}];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=yield Promise.all(o.map(r=>n(this,void 0,void 0,function*(){try{const n={to:t.id,data:r.signature+i.encodeParameters(r.inputTypes,[e]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(r.outputTypes,o.result)[0]}catch(t){return null}})));return{id:e,uri:r[0],imprint:r[1]?r[1].substr(2):r[1]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x6352211e",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x4f6ccce7",s=["uint256"],u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x70a08231",s=["address"],u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s=r(44),u="0x01ffc9a7",a=["bytes8"],h=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){return Promise.all([o.AssetLedgerCapability.DESTROY_ASSET,o.AssetLedgerCapability.REVOKE_ASSET,o.AssetLedgerCapability.TOGGLE_TRANSFERS,o.AssetLedgerCapability.UPDATE_ASSET].map(e=>n(this,void 0,void 0,function*(){const r=s.getInterfaceCode(e),n={to:t.id,data:u+i.encodeParameters(a,[r]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(h,o.result)[0]?e:-1}))).then(t=>t.filter(t=>-1!==t).sort()).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0xfbca0ce1",inputTypes:[],outputTypes:["string"]},{signature:"0x075b1a09",inputTypes:[],outputTypes:["bytes32"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return n(this,void 0,void 0,function*(){const e=yield Promise.all(o.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+i.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],uriBase:e[2],schemaId:e[3],supply:e[4]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xe985e9c5",s=["address","address"],u=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:o+i.encodeParameters(s,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(u,a.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xb187bd26",s=[],u=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){try{const e={to:t.id,data:o+i.encodeParameters(s,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!i.decodeParameters(u,r.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(17)),n(r(79)),n(r(45))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(15),u=r(80),a=r(81),h=r(82),c=r(83),l=r(84),d=r(85),f=r(86);class p{static getInstance(t,e){return new p(t,e)}constructor(t,e){this._id=o.normalizeAddress(e||t.orderGatewayId),this._provider=t}get id(){return this._id}get provider(){return this._provider}claim(t){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?c.default(this,t):h.default(this,t)})}perform(t,e){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),a.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),u.default(this,t)})}getProxyAccountId(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}isValidSignature(t,e){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=s.normalizeOrderIds(t),l.default(this,t)})}}e.OrderGateway=p},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(15),u="0x36d63aca",a=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=s.createRecipeTuple(t,e),n={from:t.provider.accountId,to:t.id,data:u+o.encodeParameters(a,[r]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(15),u="0x8b1d8335",a=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=s.createRecipeTuple(t,e),h=s.createSignatureTuple(r),c={from:t.provider.accountId,to:t.id,data:u+o.encodeParameters(a,[n,h]).substr(2)},l=yield t.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t.provider,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(15);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"eth_sign",params:[t.provider.accountId,r]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(15);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"personal_sign",params:[r,t.provider.accountId,null]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(15),s="0xd1c87f30",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"],a=["bytes32"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=o.createRecipeTuple(t,e);try{const e={to:t.id,data:s+i.encodeParameters(u,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return i.decodeParameters(a,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xabd90f85",s=["uint8"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(15),s="0x8fa76d8d",u=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],a=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=o.createOrderHash(t,e),h=o.createSignatureTuple(r);try{const r={to:t.id,data:s+i.encodeParameters(u,[e.makerId,n,h]).substr(2)},o=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(a,o.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(88))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(3),s=r(89),u=r(90),a=r(91),h=r(92),c=r(93),l=r(94),d=r(95);class f{static deploy(t,e){return n(this,void 0,void 0,function*(){return u.default(t,e)})}static getInstance(t,e){return new f(t,e)}constructor(t,e){this._id=i.normalizeAddress(e),this._provider=t}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),t=i.normalizeAddress(t),e=i.normalizeAddress(e),c.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=i.normalizeAddress(t),l.default(this,t)})}getInfo(){return n(this,void 0,void 0,function*(){return d.default(this)})}isApprovedValue(t,e,r){return n(this,void 0,void 0,function*(){"string"!=typeof r&&(r=yield r.getProxyAccountId(1)),e=i.normalizeAddress(e),r=i.normalizeAddress(r);const n=yield c.default(this,e,r);return i.bigNumberify(n).gte(i.bigNumberify(t))})}approveValue(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),e=i.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!i.bigNumberify(t).isZero()&&!i.bigNumberify(r).isZero())throw new o.ProviderError(o.ProviderIssue.GENERAL,"First set approval to 0. ERC20 token potential attack.");return s.default(this,e,t)})}disapproveValue(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(1)),t=i.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=i.normalizeAddress(t.senderId),r=i.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}}e.ValueLedger=f},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x095ea7b3",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s=r(16),u=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:a,supply:h}){return n(this,void 0,void 0,function*(){const n=(yield s.fetch(t.valueLedgerSource).then(t=>t.json())).TokenMock.evm.bytecode.object,c={from:t.accountId,data:`0x${n}${o.encodeParameters(u,[e,r,a,h]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0xa9059cbb",u=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(1),o=r(0),s="0x23b872dd",u=["address","address","uint256"];e.default=function(t,e,r,a){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:s+o.encodeParameters(u,[e,r,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xdd62ed3e",s=["address","address"],u=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:o+i.encodeParameters(s,[e,r]).substr(2)},a=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return i.decodeParameters(u,a.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x70a08231",s=["address"],u=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+i.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(u,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=[{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 n(this,void 0,void 0,function*(){const e=yield Promise.all(o.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+i.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return i.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}})}},,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(46),r(51),r(78),r(87))}]); \ No newline at end of file +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],c=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(n){return new M(t,e,t).update(n)[r]()}},d=function(t,e,r){return function(n,i){return new M(t,e,i).update(n)[r]()}},l=function(t,e){var r=h(t,e,"hex");r.create=function(){return new M(t,e,t)},r.update=function(t){return r.create().update(t)};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}M.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,c=0,h=this.s;c>2]|=t[c]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},M.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,c,h,d,l,f,p,v,m,y,g,w,_,M,b,A,E,x,P,T,I,N,O,S,R,k,L,j,C,U,G,D,F,B,z,V,Z,$,K,q,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ct,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],d=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])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(c<<1|h>>>31),r=o^(h<<1|c>>>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=s^(d<<1|l>>>31),r=a^(l<<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=c^(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=d^(i<<1|o>>>31),r=l^(o<<1|i>>>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],m=t[1],q=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,N=t[20]<<3|t[21]>>>29,O=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,j=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,M=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,$=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,T=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,B=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&_,t[10]=x^~T&N,t[11]=P^~I&O,t[20]=j^~U&D,t[21]=C^~G&F,t[30]=$^~q&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&M,t[3]=g^~_&b,t[12]=T^~N&S,t[13]=I^~O&R,t[22]=U^~D&B,t[23]=G^~F&z,t[32]=q^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~M&A,t[5]=_^~b&E,t[14]=N^~S&k,t[15]=O^~R&L,t[24]=D^~B&V,t[25]=F^~z&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ct,t[45]=st^~at&ht,t[6]=M^~A&v,t[7]=b^~E&m,t[16]=S^~k&x,t[17]=R^~L&P,t[26]=B^~V&j,t[27]=z^~Z&C,t[36]=W^~Q&$,t[37]=Y^~tt&K,t[46]=ut^~ct&et,t[47]=at^~ht&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=k^~x&T,t[19]=L^~P&I,t[28]=V^~j&U,t[29]=Z^~C&G,t[38]=Q^~$&q,t[39]=tt^~K&H,t[48]=ct^~et&nt,t[49]=ht^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(m=0;m1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.getInterfaceCode=function(t){return t==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==n.AssetLedgerCapability.UPDATE_ASSET?"0xbda0e852":t==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.XCERT_CREATE=0]="XCERT_CREATE",t[t.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",t[t.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",t[t.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER"}(e.OrderGatewayProxy||(e.OrderGatewayProxy={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.GeneralAssetLedgerAbility=n.GeneralAssetLedgerAbility,e.SuperAssetLedgerAbility=n.SuperAssetLedgerAbility,e.AssetLedgerCapability=n.AssetLedgerCapability,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(49))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(75)),n(r(46))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(50),u=r(51),a=r(52),c=r(53),h=r(54),d=r(55),l=r(56),f=r(57),p=r(58),v=r(59),m=r(60),y=r(61),g=r(62),w=r(63),_=r(64),M=r(65),b=r(67),A=r(68),E=r(69),x=r(70),P=r(71),T=r(72),I=r(73),N=r(74);e.AssetLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),w.default(this,t)})}getApprovedAccount(t){return n(this,void 0,void 0,function*(){return M.default(this,t)})}getAssetAccount(t){return n(this,void 0,void 0,function*(){return A.default(this,t)})}getAsset(t){return n(this,void 0,void 0,function*(){return b.default(this,t)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),x.default(this,t)})}getCapabilities(){return n(this,void 0,void 0,function*(){return P.default(this)})}getInfo(){return n(this,void 0,void 0,function*(){return T.default(this)})}getAssetIdAt(t){return n(this,void 0,void 0,function*(){return E.default(this,t)})}getAccountAssetIdAt(t,e){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),_.default(this,t,e)})}isApprovedAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),(e=this._provider.encoder.normalizeAddress(e))===(yield M.default(this,t))})}isTransferable(){return n(this,void 0,void 0,function*(){return N.default(this)})}approveAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)})}disapproveAccount(t){return n(this,void 0,void 0,function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)})}grantAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0)),t=this._provider.encoder.normalizeAddress(t);let r=i.bigNumberify(0);return e.forEach(t=>{r=r.add(t)}),h.default(this,t,r)})}createAsset(t){return n(this,void 0,void 0,function*(){const e=t.imprint||"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=this._provider.encoder.normalizeAddress(t.receiverId);return u.default(this,r,t.id,`0x${e}`)})}destroyAsset(t){return n(this,void 0,void 0,function*(){return c.default(this,t)})}revokeAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0));let r=!1;-1!==e.indexOf(o.SuperAssetLedgerAbility.MANAGE_ABILITIES)&&(r=!0),t=this._provider.encoder.normalizeAddress(t);let n=i.bigNumberify(0);return e.forEach(t=>{n=n.add(t)}),d.default(this,t,n,r)})}revokeAsset(t){return n(this,void 0,void 0,function*(){return l.default(this,t)})}transferAsset(t){return n(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 n(this,void 0,void 0,function*(){return v.default(this,!0)})}disableTransfers(){return n(this,void 0,void 0,function*(){return v.default(this,!1)})}updateAsset(t,e){return n(this,void 0,void 0,function*(){return g.default(this,t,e.imprint)})}update(t){return n(this,void 0,void 0,function*(){return y.default(this,t.uriBase)})}approveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!0)})}disapproveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!1)})}isApprovedOperator(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xb0e329e4",s=["address","uint256","bytes32"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=r(45),u=["string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriBase:a,schemaId:c,capabilities:h}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.assetLedgerSource).then(t=>t.json())).XcertMock.evm.bytecode.object,d=(h||[]).map(t=>s.getInterfaceCode(t)),l={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(u,[e,r,a,c,d]).substr(2)}`},f=yield t.post({method:"eth_sendTransaction",params:[l]});return new i.Mutation(t,f.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x9d118770",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x0ab319e8",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xaca910e7",s=["address","uint256","bool"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x20c5429b",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0);e.default=function(t,e,r,o,s){return n(this,void 0,void 0,function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",u=["address","address","uint256"];void 0!==s&&u.push("bytes");const a=[e,r,o,s].filter(t=>void 0!==t),c={from:t.provider.accountId,to:t.id,data:n+t.provider.encoder.encodeParameters(u,a).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa22cb465",s=["address","bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbedb86fb",s=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[!e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x27fc0cff",s=["string"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbda0e852",s=["uint256","bytes32"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o="0xba00a330",s=["address","uint256"],u=["bool"];e.default=function(t,e){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].map(r=>n(this,void 0,void 0,function*(){const n={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]?r:-1}))).then(t=>t.filter(t=>-1!==t).sort((t,e)=>t-e)).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x2f745c59",o=["address","uint256"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(66),o="0x081812fc",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(r){return i.default(t,e)}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x481af3d3",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x70c31afc",inputTypes:["uint256"],outputTypes:["bytes32"]}];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=yield Promise.all(i.map(r=>n(this,void 0,void 0,function*(){try{const n={to:t.id,data:r.signature+t.provider.encoder.encodeParameters(r.inputTypes,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(r.outputTypes,i.result)[0]}catch(t){return null}})));return{id:e,uri:r[0],imprint:r[1]?r[1].substr(2):r[1]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x6352211e",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x4f6ccce7",o=["uint256"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o=r(45),s="0x01ffc9a7",u=["bytes8"],a=["bool"];e.default=function(t){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(e=>n(this,void 0,void 0,function*(){const r=o.getInterfaceCode(e),n={to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(a,i.result)[0]?e:-1}))).then(t=>t.filter(t=>-1!==t).sort()).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0xfbca0ce1",inputTypes:[],outputTypes:["string"]},{signature:"0x075b1a09",inputTypes:[],outputTypes:["bytes32"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],uriBase:e[2],schemaId:e[3],supply:e[4]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xe985e9c5",o=["address","address"],s=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xb187bd26",o=[],s=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){try{const e={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s=r(76),u=r(77),a=r(78),c=r(79),h=r(80),d=r(81),l=r(82);e.OrderGateway=class{static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e||t.orderGatewayId)}get id(){return this._id}get provider(){return this._provider}claim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?c.default(this,t):a.default(this,t)})}perform(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),u.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),s.default(this,t)})}getProxyAccountId(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}isValidSignature(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),l.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),h.default(this,t)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x36d63aca",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=o.createRecipeTuple(t,e),n={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x8b1d8335",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=o.createRecipeTuple(t,e),a=o.createSignatureTuple(r),c={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[n,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"eth_sign",params:[t.provider.accountId,r]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"personal_sign",params:[r,t.provider.accountId,null]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0xd1c87f30",s=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"],u=["bytes32"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createRecipeTuple(t,e);try{const e={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xabd90f85",o=["uint8"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0x8fa76d8d",s=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],u=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=i.createOrderHash(t,e),a=i.createSignatureTuple(r);try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e.makerId,n,a]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(84))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(85),u=r(86),a=r(87),c=r(88),h=r(89),d=r(90),l=r(91);e.ValueLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return u.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),h.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),d.default(this,t)})}getInfo(){return n(this,void 0,void 0,function*(){return l.default(this)})}isApprovedValue(t,e,r){return n(this,void 0,void 0,function*(){"string"!=typeof r&&(r=yield r.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,e,r);return i.bigNumberify(n).gte(i.bigNumberify(t))})}approveValue(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!i.bigNumberify(t).isZero()&&!i.bigNumberify(r).isZero())throw new o.ProviderError(o.ProviderIssue.GENERAL,"First set approval to 0. ERC20 token potential attack.");return s.default(this,e,t)})}disapproveValue(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?c.default(this,e,r,t.value):a.default(this,r,t.value)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:u,supply:a}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.valueLedgerSource).then(t=>t.json())).TokenMock.evm.bytecode.object,c={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(s,[e,r,u,a]).substr(2)}`},h=yield t.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa9059cbb",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xdd62ed3e",o=["address","address"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.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 n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(93))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(94),o=r(17),s=r(96);class u{static getInstance(t){return new u(t)}constructor(t){this.schema=t.schema,this.merkle=new i.Merkle(Object.assign({hasher:t=>n(this,void 0,void 0,function*(){return o.sha(256,s.toString(t))}),noncer:t=>n(this,void 0,void 0,function*(){return o.sha(256,t.join("."))})},t))}notarize(t){return n(this,void 0,void 0,function*(){const e=this.buildSchemaProps(t),r=yield this.buildCompoundProps(e);return(yield this.buildRecipes(r)).map(t=>({path:t.path,nodes:t.nodes,values:t.values}))})}expose(t,e){const r={};return e.forEach(e=>{const n=s.readPath(e,t);s.writePath(e,n,r)}),JSON.parse(JSON.stringify(r))}disclose(t,e){return n(this,void 0,void 0,function*(){const r=this.buildSchemaProps(t),n=yield this.buildCompoundProps(r);return(yield this.buildRecipes(n,e)).map(t=>({path:t.path,nodes:t.nodes,values:t.values}))})}calculate(t,e){return n(this,void 0,void 0,function*(){try{return this.checkDataInclusion(t,e)?this.imprintRecipes(e):null}catch(t){return null}})}imprint(t){return n(this,void 0,void 0,function*(){return this.notarize(t).then(t=>t[0].nodes[0].hash)})}buildSchemaProps(t,e=this.schema,r=[]){return"array"===e.type?(t||[]).map((t,n)=>this.buildSchemaProps(t,e.items,[...r,n])).reduce((t,e)=>t.concat(e),[]):"object"===e.type?Object.keys(e.properties).sort().map(n=>{const i=this.buildSchemaProps((t||{})[n],e.properties[n],[...r,n]);return-1===["object","array"].indexOf(e.properties[n].type)?[i]:i}).reduce((t,e)=>t.concat(e),[]):{path:r,value:t,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(t){return n(this,void 0,void 0,function*(){t=[...t];const e=this.buildPropGroups(t),r=Object.keys(e).sort((t,e)=>t>e?-1:1).filter(t=>""!==t);for(const n of r){const r=e[n],i=[...t.filter(t=>t.group===n)].sort((t,e)=>t.key>e.key?1:-1).map(t=>t.value),o=yield this.merkle.notarize(i,r);t.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return t.sort((t,e)=>t.key>e.key?1:-1)})}buildRecipes(t,e=null){return n(this,void 0,void 0,function*(){const r=e?s.stepPaths(e).map(t=>t.join(".")):null,i={};return t.forEach(t=>i[t.group]=t.path.slice(0,-1)),Promise.all(Object.keys(i).map(e=>n(this,void 0,void 0,function*(){const n=t.filter(t=>t.group===e).map(t=>t.value);let o=yield this.merkle.notarize(n,i[e]);if(r){const n=t.filter(t=>t.group===e).map((t,e)=>-1===r.indexOf(t.key)?-1:e).filter(t=>-1!==t);o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[e].join(".")))return{path:i[e],values:o.values,nodes:o.nodes,key:i[e].join("."),group:i[e].slice(0,-1).join(".")}}))).then(t=>t.filter(t=>!!t))})}checkDataInclusion(t,e){const r=this.buildSchemaProps(t);e=s.cloneObject(e).map(t=>Object.assign({key:t.path.join("."),group:t.path.slice(0,-1).join(".")},t));for(const n of r){const r=s.readPath(n.path,t);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=e.find(t=>t.key===i);if(!o)return!1;const u=this.getPathIndexes(n.path).pop();if(o.values.find(t=>t.index===u).value!==r)return!1}return!0}imprintRecipes(t){return n(this,void 0,void 0,function*(){if(0===t.length)return this.getEmptyImprint();t=s.cloneObject(t).map(t=>Object.assign({key:t.path.join("."),group:t.path.slice(0,-1).join(".")},t)).sort((t,e)=>t.path.length>e.path.length?-1:1);for(const e of t){const r=yield this.merkle.imprint(e).catch(()=>"");e.nodes.unshift({index:0,hash:r});const n=e.path.slice(0,-1).join("."),i=e.path.slice(0,-1),o=this.getPathIndexes(e.path).slice(-1).pop(),s=t.find(t=>t.key===n);s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const e=t.find(t=>""===t.key);return e?e.nodes.find(t=>0===t.index).hash:this.getEmptyImprint()})}getPathIndexes(t){const e=[];let r=this.schema;for(const n of t)"array"===r.type?(e.push(n),r=r.items):"object"===r.type?(e.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):e.push(void 0);return e}getEmptyImprint(){return n(this,void 0,void 0,function*(){return this.merkle.notarize([]).then(t=>t.nodes[0].hash)})}buildPropGroups(t){const e={};return t.map(t=>{const e=[];return t.path.map(t=>(e.push(t),[...e]))}).reduce((t,e)=>t.concat(e),[]).forEach(t=>e[t.slice(0,-1).join(".")]=t.slice(0,-1)),e}}e.Cert=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(95))},function(t,e,r){"use strict";var n,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.VALUE=0]="VALUE",t[t.LEAF=1]="LEAF",t[t.NODE=2]="NODE"}(n=e.MerkleHasherPosition||(e.MerkleHasherPosition={}));e.Merkle=class{constructor(t){this._options=Object.assign({hasher:t=>t,noncer:()=>""},t)}hash(t,e,r){return this._options.hasher(t,e,r)}nonce(t){return this._options.noncer(t)}notarize(t,e=[]){return i(this,void 0,void 0,function*(){const r=[...t],i=[],o=yield this._options.noncer([...e,r.length]),s=[yield this._options.hasher(o,[...e,r.length],n.NODE)];for(let t=r.length-1;t>=0;t--){const o=s[0];i.unshift(yield this._options.noncer([...e,t]));const u=yield this._options.hasher(r[t],[...e,t],n.VALUE);s.unshift(yield this._options.hasher(`${u}${i[0]}`,[...e,t],n.LEAF));const a=s[0];s.unshift(yield this._options.hasher(`${a}${o}`,[...e,t],n.NODE))}return{values:r.map((t,e)=>({index:e,value:t,nonce:i[e]})),nodes:s.map((t,e)=>({index:e,hash:t}))}})}disclose(t,e){return i(this,void 0,void 0,function*(){const r=Math.max(...e.map(t=>t+1),0),n=[],i=[t.nodes.find(t=>t.index===2*r)];for(let o=r-1;o>=0;o--)-1!==e.indexOf(o)?n.unshift(t.values.find(t=>t.index===o)):i.unshift(t.nodes.find(t=>t.index===2*o+1));return{values:n,nodes:i}})}imprint(t){return i(this,void 0,void 0,function*(){const e=[...yield Promise.all(t.values.map((t,e)=>i(this,void 0,void 0,function*(){const r=yield this._options.hasher(t.value,[e],n.VALUE);return{index:2*t.index+1,hash:yield this._options.hasher(`${r}${t.nonce}`,[e],n.LEAF),value:t.value}}))),...t.nodes];for(let t=Math.max(...e.map(t=>t.index+1),0)-1;t>=0;t-=2){const r=e.find(e=>e.index===t),i=e.find(e=>e.index===t-1);r&&i&&e.unshift({index:t-2,hash:yield this._options.hasher(`${i.hash}${r.hash}`,[t],n.NODE)})}const r=e.find(t=>0===t.index);return r?r.hash:null})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){try{return null==t?"":`${t}`}catch(t){return""}},e.cloneObject=function(t){return JSON.parse(JSON.stringify(t))},e.stepPaths=function(t){const e={"":[]};return t.forEach(t=>{const r=[];t.forEach(t=>{r.push(t),e[r.join(".")]=[...r]})}),Object.keys(e).sort().map(t=>e[t])},e.readPath=function t(e,r){try{return Array.isArray(e)?0===e.length?r:t(e.slice(1),r[e[0]]):void 0}catch(t){return}},e.writePath=function(t,e,r={}){let n=r=r||{};for(let r=0;r=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}),i(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=[],u=0;u>4]+c[15&a])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function d(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 f(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=d(t.r,32),o=d(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,e+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=d,e.splitSignature=f,e.joinSignature=function(t){return l(a([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var c={},l=0;l<10;l++)c[String(l)]=String(l);for(l=0;l<26;l++)c[String.fromCharCode(65+l)]=String(10+l);var d,f=Math.floor((d=9007199254740991,Math.log10?Math.log10(d):Math.log(d)/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+=c[t]});e.length>=f;){var r=e.substring(0,f);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function v(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new i.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(u.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),c=r(11),l=o(r(3)),d=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(f);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),A=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){l.throwError("invalid number value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){l.throwError("invalid "+this.name+" value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||l.throwError("expected array value",l.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),l.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&l.throwError("invalid "+r[1]+" bit length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(d))return(0===(i=parseInt(r[1]))||i>32)&&l.throwError("invalid bytes length",l.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=c.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(l.throwError("invalid type",l.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){l.checkNew(this,t),r||(r=e.defaultCoerceFunc),c.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&l.throwError("types/values length mismatch",l.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):c.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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 d(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,l=67108863&a,d=Math.min(h,e.length-1),f=Math.max(0,h-t.length+1);f<=d;f++){var p=h-f|0;c+=(s=(i=0|t.words[p])*(o=0|e.words[f])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,a=0|c}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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}n(!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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),c=this.clone();if(a){for(u=0;!c.isZero();u++)s=c.andln(255),c.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,m=0|s[2],y=8191&m,g=m>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],A=8191&b,E=b>>>13,x=0|s[5],T=8191&x,N=x>>>13,I=0|s[6],P=8191&I,S=I>>>13,O=0|s[7],R=8191&O,L=O>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,z=B>>>13,V=0|u[1],Z=8191&V,q=V>>>13,$=0|u[2],H=8191&$,K=$>>>13,W=0|u[3],J=8191&W,X=W>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,ct=0|u[8],lt=8191&ct,dt=ct>>>13,ft=0|u[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(h+(n=Math.imul(l,F))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,F)|0))<<13)|0;h=((o=Math.imul(d,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,z))+Math.imul(v,F)|0,o=Math.imul(v,z);var yt=(h+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,q)|0)+Math.imul(d,Z)|0))<<13)|0;h=((o=o+Math.imul(d,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,z))+Math.imul(g,F)|0,o=Math.imul(g,z),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 gt=(h+(n=n+Math.imul(l,H)|0)|0)+((8191&(i=(i=i+Math.imul(l,K)|0)+Math.imul(d,H)|0))<<13)|0;h=((o=o+Math.imul(d,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,z))+Math.imul(_,F)|0,o=Math.imul(_,z),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(v,H)|0,o=o+Math.imul(v,K)|0;var wt=(h+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,J)|0))<<13)|0;h=((o=o+Math.imul(d,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,F),i=(i=Math.imul(A,z))+Math.imul(E,F)|0,o=Math.imul(E,z),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,X)|0;var Mt=(h+(n=n+Math.imul(l,Q)|0)|0)+((8191&(i=(i=i+Math.imul(l,tt)|0)+Math.imul(d,Q)|0))<<13)|0;h=((o=o+Math.imul(d,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,z))+Math.imul(N,F)|0,o=Math.imul(N,z),n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,q)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,J)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var _t=(h+(n=n+Math.imul(l,rt)|0)|0)+((8191&(i=(i=i+Math.imul(l,nt)|0)+Math.imul(d,rt)|0))<<13)|0;h=((o=o+Math.imul(d,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,z))+Math.imul(S,F)|0,o=Math.imul(S,z),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,q)|0,n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,K)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,J)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var bt=(h+(n=n+Math.imul(l,ot)|0)|0)+((8191&(i=(i=i+Math.imul(l,st)|0)+Math.imul(d,ot)|0))<<13)|0;h=((o=o+Math.imul(d,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(R,F),i=(i=Math.imul(R,z))+Math.imul(L,F)|0,o=Math.imul(L,z),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(N,H)|0,o=o+Math.imul(N,K)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,X)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(h+(n=n+Math.imul(l,at)|0)|0)+((8191&(i=(i=i+Math.imul(l,ht)|0)+Math.imul(d,at)|0))<<13)|0;h=((o=o+Math.imul(d,ht)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,z))+Math.imul(j,F)|0,o=Math.imul(j,z),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,q)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(N,J)|0,o=o+Math.imul(N,X)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ht)|0;var Et=(h+(n=n+Math.imul(l,lt)|0)|0)+((8191&(i=(i=i+Math.imul(l,dt)|0)+Math.imul(d,lt)|0))<<13)|0;h=((o=o+Math.imul(d,dt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,z))+Math.imul(D,F)|0,o=Math.imul(D,z),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(P,J)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,lt)|0,i=(i=i+Math.imul(p,dt)|0)+Math.imul(v,lt)|0,o=o+Math.imul(v,dt)|0;var xt=(h+(n=n+Math.imul(l,pt)|0)|0)+((8191&(i=(i=i+Math.imul(l,vt)|0)+Math.imul(d,pt)|0))<<13)|0;h=((o=o+Math.imul(d,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(D,Z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,X)|0)+Math.imul(L,J)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,lt)|0,i=(i=i+Math.imul(y,dt)|0)+Math.imul(g,lt)|0,o=o+Math.imul(g,dt)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;h=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,J)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,J)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ht)|0)+Math.imul(E,at)|0,o=o+Math.imul(E,ht)|0,n=n+Math.imul(M,lt)|0,i=(i=i+Math.imul(M,dt)|0)+Math.imul(_,lt)|0,o=o+Math.imul(_,dt)|0;var Nt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,J),i=(i=Math.imul(G,X))+Math.imul(D,J)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ht)|0,n=n+Math.imul(A,lt)|0,i=(i=i+Math.imul(A,dt)|0)+Math.imul(E,lt)|0,o=o+Math.imul(E,dt)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,vt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,lt)|0,i=(i=i+Math.imul(T,dt)|0)+Math.imul(N,lt)|0,o=o+Math.imul(N,dt)|0;var Pt=(h+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(E,pt)|0))<<13)|0;h=((o=o+Math.imul(E,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(P,lt)|0,i=(i=i+Math.imul(P,dt)|0)+Math.imul(S,lt)|0,o=o+Math.imul(S,dt)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,vt)|0)+Math.imul(N,pt)|0))<<13)|0;h=((o=o+Math.imul(N,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(R,lt)|0,i=(i=i+Math.imul(R,dt)|0)+Math.imul(L,lt)|0,o=o+Math.imul(L,dt)|0;var Ot=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,lt)|0,i=(i=i+Math.imul(C,dt)|0)+Math.imul(j,lt)|0,o=o+Math.imul(j,dt)|0;var Rt=(h+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,lt),i=(i=Math.imul(G,dt))+Math.imul(D,lt)|0,o=Math.imul(D,dt);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,vt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,vt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,vt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=mt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=At,a[8]=Et,a[9]=xt,a[10]=Tt,a[11]=Nt,a[12]=It,a[13]=Pt,a[14]=St,a[15]=Ot,a[16]=Rt,a[17]=Lt,a[18]=kt,0!==h&&(a[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=d),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?d(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n: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,n=0;n>=1;return n},v.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==c||h>=i);h--){var l=0|this.words[h];this.words[h]=c<<26-o|l>>>o,c=l&u}return a&&0!==c&&(a.words[a.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;l--){var d=67108864*(0|n.words[i.length+l])+(0|n.words[i.length+l-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,l),n.isZero()||(n.negative^=1);u&&(u.words[l]=d)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var c=r.clone(),l=e.clone();!e.isZero();){for(var d=0,f=1;0==(e.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(e.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(c),s.isub(l)),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;)(u.isOdd()||a.isOdd())&&(u.iadd(c),a.isub(l)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var h=0,c=1;0==(e.words[0]&c)&&h<26;++h,c<<=1);if(h>0)for(e.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var l=0,d=1;0==(r.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(r.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(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 y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}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 g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return m[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.redNeg(),h=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new o(2*c*c).toRed(this);0!==this.pow(c,h).cmp(a);)c.redIAdd(a);for(var l=this.pow(c,i),d=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(u);){for(var v=f,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var h=e.words[n],c=a-1;c>=0;c--){var l=h>>c&1;i!==r[0]&&(i=this.sqr(i)),0!==l||0!==s?(s<<=1,s|=l,(4===++u||0===n&&0===c)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new A(t)},i(A,b),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),c=r(39),l=s(r(3)),d=new u.default.BN(-1);function f(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 p(t){return y(t)._bn}function v(t){return new m(f(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(l.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))):l.throwError("invalid BigNumber string value",l.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&l.throwError("underflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",f(new u.default.BN(r)))}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",f(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",f(new u.default.BN(a.hexlify(r).substring(2),16))):l.throwError("invalid BigNumber value",l.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(d):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return v(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return v(this._bn.toTwos(t))},e.prototype.add=function(t){return v(this._bn.add(p(t)))},e.prototype.sub=function(t){return v(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&l.throwError("division by zero",l.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),v(this._bn.div(p(t)))},e.prototype.mul=function(t){return v(this._bn.mul(p(t)))},e.prototype.mod=function(t){return v(this._bn.mod(p(t)))},e.prototype.pow=function(t){return v(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return v(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){l.throwError("overflow",l.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(c.BigNumber);function y(t){return t instanceof m?t:new m(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function c(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function l(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,c=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return d(this,t,!0)},u.prototype.rawListeners=function(t){return d(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,c,l,d,f,p,v,m,y,g,w,M,_,b,A,E,x,T,N,I,P,S,O,R,L,k,C,j,U,G,D,B,F,z,V,Z,q,$,H,K,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(h<<1|c>>>31),r=s^(c<<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=u^(l<<1|d>>>31),r=a^(d<<1|l>>>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=c^(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=l^(i<<1|s>>>31),r=d^(s<<1|i>>>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],m=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,N=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,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&M,t[10]=x^~N&P,t[11]=T^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&W,t[31]=$^~K&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=N^~P&O,t[13]=I^~S&R,t[22]=U^~D&F,t[23]=G^~B&z,t[32]=H^~W&X,t[33]=K^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&A,t[5]=M^~b&E,t[14]=P^~O&L,t[15]=S^~R&k,t[24]=D^~F&V,t[25]=B^~z&Z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=O^~L&x,t[17]=R^~k&T,t[26]=F^~V&C,t[27]=z^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~ct&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&N,t[19]=k^~T&I,t[28]=V^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,c=t.blockCount,l=t.outputBlocks,d=t.s,f=0;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=m-h,t.block=a[c],m=0;m>2]|=n[3&m],t.lastByteIndex===h)for(a[0]=a[c],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%c==0&&(s(d),m=0)}return"0x"+v})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.5.7 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2016 + * @license MIT + */ +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],c=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},l=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},d=function(t,e){var r=c(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,c=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,c,l,d,f,p,v,m,y,g,w,M,_,b,A,E,x,T,N,I,P,S,O,R,L,k,C,j,U,G,D,B,F,z,V,Z,q,$,H,K,W,J,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,ct;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],h=t[4]^t[14]^t[24]^t[34]^t[44],c=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],d=t[7]^t[17]^t[27]^t[37]^t[47],e=(f=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(h<<1|c>>>31),r=o^(c<<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=s^(l<<1|d>>>31),r=a^(d<<1|l>>>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=c^(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=l^(i<<1|o>>>31),r=d^(o<<1|i>>>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],m=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,P=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,W=t[22]<<10|t[23]>>>22,J=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ht=t[42]<<2|t[43]>>>30,ct=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,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,N=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,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&M,t[10]=x^~N&P,t[11]=T^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&W,t[31]=$^~K&J,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=N^~P&O,t[13]=I^~S&R,t[22]=U^~D&F,t[23]=G^~B&z,t[32]=H^~W&X,t[33]=K^~J&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&A,t[5]=M^~b&E,t[14]=P^~O&L,t[15]=S^~R&k,t[24]=D^~F&V,t[25]=B^~z&Z,t[34]=W^~X&Q,t[35]=J^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at&ct,t[6]=_^~A&v,t[7]=b^~E&m,t[16]=O^~L&x,t[17]=R^~k&T,t[26]=F^~V&C,t[27]=z^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~ct&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&N,t[19]=k^~T&I,t[28]=V^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=ct^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(m=0;m1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.getInterfaceCode=function(t){return t==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==n.AssetLedgerCapability.UPDATE_ASSET?"0xbda0e852":t==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.GeneralAssetLedgerAbility=n.GeneralAssetLedgerAbility,e.SuperAssetLedgerAbility=n.SuperAssetLedgerAbility,e.AssetLedgerCapability=n.AssetLedgerCapability,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(49))},,function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(50),u=r(51),a=r(52),h=r(53),c=r(54),l=r(55),d=r(56),f=r(57),p=r(58),v=r(59),m=r(60),y=r(61),g=r(62),w=r(63),M=r(64),_=r(65),b=r(67),A=r(68),E=r(69),x=r(70),T=r(71),N=r(72),I=r(73),P=r(74);e.AssetLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),w.default(this,t)})}getApprovedAccount(t){return n(this,void 0,void 0,function*(){return _.default(this,t)})}getAssetAccount(t){return n(this,void 0,void 0,function*(){return A.default(this,t)})}getAsset(t){return n(this,void 0,void 0,function*(){return b.default(this,t)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),x.default(this,t)})}getCapabilities(){return n(this,void 0,void 0,function*(){return T.default(this)})}getInfo(){return n(this,void 0,void 0,function*(){return N.default(this)})}getAssetIdAt(t){return n(this,void 0,void 0,function*(){return E.default(this,t)})}getAccountAssetIdAt(t,e){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),M.default(this,t,e)})}isApprovedAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),(e=this._provider.encoder.normalizeAddress(e))===(yield _.default(this,t))})}isTransferable(){return n(this,void 0,void 0,function*(){return P.default(this)})}approveAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)})}disapproveAccount(t){return n(this,void 0,void 0,function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)})}grantAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0)),t=this._provider.encoder.normalizeAddress(t);let r=i.bigNumberify(0);return e.forEach(t=>{r=r.add(t)}),c.default(this,t,r)})}createAsset(t){return n(this,void 0,void 0,function*(){const e=t.imprint||"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=this._provider.encoder.normalizeAddress(t.receiverId);return u.default(this,r,t.id,`0x${e}`)})}destroyAsset(t){return n(this,void 0,void 0,function*(){return h.default(this,t)})}revokeAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0));let r=!1;-1!==e.indexOf(o.SuperAssetLedgerAbility.MANAGE_ABILITIES)&&(r=!0),t=this._provider.encoder.normalizeAddress(t);let n=i.bigNumberify(0);return e.forEach(t=>{n=n.add(t)}),l.default(this,t,n,r)})}revokeAsset(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}transferAsset(t){return n(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 n(this,void 0,void 0,function*(){return v.default(this,!0)})}disableTransfers(){return n(this,void 0,void 0,function*(){return v.default(this,!1)})}updateAsset(t,e){return n(this,void 0,void 0,function*(){return g.default(this,t,e.imprint)})}update(t){return n(this,void 0,void 0,function*(){return y.default(this,t.uriBase)})}approveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!0)})}disapproveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!1)})}isApprovedOperator(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xb0e329e4",s=["address","uint256","bytes32"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=r(45),u=["string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriBase:a,schemaId:h,capabilities:c}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.assetLedgerSource).then(t=>t.json())).XcertMock.evm.bytecode.object,l=(c||[]).map(t=>s.getInterfaceCode(t)),d={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(u,[e,r,a,h,l]).substr(2)}`},f=yield t.post({method:"eth_sendTransaction",params:[d]});return new i.Mutation(t,f.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x9d118770",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x0ab319e8",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xaca910e7",s=["address","uint256","bool"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x20c5429b",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0);e.default=function(t,e,r,o,s){return n(this,void 0,void 0,function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",u=["address","address","uint256"];void 0!==s&&u.push("bytes");const a=[e,r,o,s].filter(t=>void 0!==t),h={from:t.provider.accountId,to:t.id,data:n+t.provider.encoder.encodeParameters(u,a).substr(2)},c=yield t.provider.post({method:"eth_sendTransaction",params:[h]});return new i.Mutation(t.provider,c.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa22cb465",s=["address","bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbedb86fb",s=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[!e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x27fc0cff",s=["string"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbda0e852",s=["uint256","bytes32"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o="0xba00a330",s=["address","uint256"],u=["bool"];e.default=function(t,e){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].map(r=>n(this,void 0,void 0,function*(){const n={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]?r:-1}))).then(t=>t.filter(t=>-1!==t).sort((t,e)=>t-e)).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x2f745c59",o=["address","uint256"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(66),o="0x081812fc",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(r){return i.default(t,e)}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x481af3d3",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x70c31afc",inputTypes:["uint256"],outputTypes:["bytes32"]}];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=yield Promise.all(i.map(r=>n(this,void 0,void 0,function*(){try{const n={to:t.id,data:r.signature+t.provider.encoder.encodeParameters(r.inputTypes,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(r.outputTypes,i.result)[0]}catch(t){return null}})));return{id:e,uri:r[0],imprint:r[1]?r[1].substr(2):r[1]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x6352211e",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x4f6ccce7",o=["uint256"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o=r(45),s="0x01ffc9a7",u=["bytes8"],a=["bool"];e.default=function(t){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(e=>n(this,void 0,void 0,function*(){const r=o.getInterfaceCode(e),n={to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(a,i.result)[0]?e:-1}))).then(t=>t.filter(t=>-1!==t).sort()).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0xfbca0ce1",inputTypes:[],outputTypes:["string"]},{signature:"0x075b1a09",inputTypes:[],outputTypes:["bytes32"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],uriBase:e[2],schemaId:e[3],supply:e[4]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xe985e9c5",o=["address","address"],s=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xb187bd26",o=[],s=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){try{const e={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return null}})}},,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(47);e.GeneralAssetLedgerAbility=n.GeneralAssetLedgerAbility,e.SuperAssetLedgerAbility=n.SuperAssetLedgerAbility,e.AssetLedgerCapability=n.AssetLedgerCapability,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(98))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(47);e.AssetLedger=class extends n.AssetLedger{}},,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(97))}]); \ No newline at end of file diff --git a/dist/0xcert-wanchain-http-provider.min.js b/dist/0xcert-wanchain-http-provider.min.js new file mode 100644 index 000000000..8eb9cbf11 --- /dev/null +++ b/dist/0xcert-wanchain-http-provider.min.js @@ -0,0 +1,10 @@ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=114)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,I=N>>>13,x=0|s[6],O=8191&x,S=x>>>13,R=0|s[7],P=8191&R,L=R>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,V=B>>>13,Z=0|u[1],z=8191&Z,q=Z>>>13,$=0|u[2],H=8191&$,K=$>>>13,J=0|u[3],W=8191&J,X=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var wt=(h+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,F),i=(i=Math.imul(T,V))+Math.imul(I,F)|0,o=Math.imul(I,V),n=n+Math.imul(E,z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,V))+Math.imul(S,F)|0,o=Math.imul(S,V),n=n+Math.imul(T,z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(I,z)|0,o=o+Math.imul(I,q)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(O,z)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(S,z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(P,z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(I,W)|0,o=o+Math.imul(I,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(I,Q)|0,o=o+Math.imul(I,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,z),i=(i=Math.imul(G,q))+Math.imul(D,z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(I,rt)|0,o=o+Math.imul(I,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(I,ot)|0,o=o+Math.imul(I,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var It=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,W),i=(i=Math.imul(G,X))+Math.imul(D,W)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(I,at)|0,o=o+Math.imul(I,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var xt=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(I,ct)|0,o=o+Math.imul(I,ft)|0;var Ot=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,ft)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(I,pt)|0))<<13)|0;h=((o=o+Math.imul(I,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,ft)|0;var Rt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=It,a[12]=xt,a[13]=Ot,a[14]=St,a[15]=Rt,a[16]=Pt,a[17]=Lt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,O,S,R,P,L,k,C,j,U,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&O,t[11]=T^~x&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~O&R,t[13]=x^~S&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&T,t[26]=F^~Z&C,t[27]=V^~z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&I,t[19]=k^~T&x,t[28]=Z^~C&U,t[29]=z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.5.7 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2016 + * @license MIT + */ +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,I,x,O,S,R,P,L,k,C,j,U,G,D,B,F,V,Z,z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,Z=t[40]<<18|t[41]>>>14,z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,I=t[18]<<20|t[19]>>>12,x=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~I&O,t[11]=T^~x&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=I^~O&R,t[13]=x^~S&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&Z,t[25]=B^~V&z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&T,t[26]=F^~Z&C,t[27]=V^~z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&I,t[19]=k^~T&x,t[28]=Z^~C&U,t[29]=z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(115))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(0)),n(r(116))},function(t,e,r){"use strict";var n=this&&this.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(t);it.json()).then(t=>e(null,t)).catch(t=>e(t,null))}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(118))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6);e.Encoder=class{constructor(){this.coder=new n.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}}}]); \ No newline at end of file diff --git a/dist/0xcert-wanchain-order-gateway.min.js b/dist/0xcert-wanchain-order-gateway.min.js new file mode 100644 index 000000000..ae543f168 --- /dev/null +++ b/dist/0xcert-wanchain-order-gateway.min.js @@ -0,0 +1,10 @@ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=119)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new T(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,F(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(F(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var D=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(F(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(F(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=D,e.defaultAbiCoder=new D},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],T=8191&N,x=N>>>13,I=0|s[6],O=8191&I,S=I>>>13,R=0|s[7],P=8191&R,k=R>>>13,L=0|s[8],C=8191&L,j=L>>>13,U=0|s[9],G=8191&U,F=U>>>13,D=0|u[0],B=8191&D,V=D>>>13,z=0|u[1],Z=8191&z,q=z>>>13,K=0|u[2],$=8191&K,H=K>>>13,J=0|u[3],X=8191&J,W=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,B))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,B)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,V))+Math.imul(m,B)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,Z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),i=(i=Math.imul(y,V))+Math.imul(g,B)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,$)|0)|0)+((8191&(i=(i=i+Math.imul(c,H)|0)+Math.imul(f,$)|0))<<13)|0;h=((o=o+Math.imul(f,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,B),i=(i=Math.imul(M,V))+Math.imul(_,B)|0,o=Math.imul(_,V),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,H)|0;var wt=(h+(n=n+Math.imul(c,X)|0)|0)+((8191&(i=(i=i+Math.imul(c,W)|0)+Math.imul(f,X)|0))<<13)|0;h=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,B),i=(i=Math.imul(E,V))+Math.imul(A,B)|0,o=Math.imul(A,V),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,$)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,W)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(T,B),i=(i=Math.imul(T,V))+Math.imul(x,B)|0,o=Math.imul(x,V),n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,H)|0)+Math.imul(_,$)|0,o=o+Math.imul(_,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,B),i=(i=Math.imul(O,V))+Math.imul(S,B)|0,o=Math.imul(S,V),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,q)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,q)|0,n=n+Math.imul(E,$)|0,i=(i=i+Math.imul(E,H)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,H)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(_,X)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,B),i=(i=Math.imul(P,V))+Math.imul(k,B)|0,o=Math.imul(k,V),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,H)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,H)|0,n=n+Math.imul(E,X)|0,i=(i=i+Math.imul(E,W)|0)+Math.imul(A,X)|0,o=o+Math.imul(A,W)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,B),i=(i=Math.imul(C,V))+Math.imul(j,B)|0,o=Math.imul(j,V),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(k,Z)|0,o=o+Math.imul(k,q)|0,n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,H)|0,n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,B),i=(i=Math.imul(G,V))+Math.imul(F,B)|0,o=Math.imul(F,V),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,$)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,H)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(S,X)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(T,Q)|0,i=(i=i+Math.imul(T,tt)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(F,Z)|0,o=Math.imul(F,q),n=n+Math.imul(C,$)|0,i=(i=i+Math.imul(C,H)|0)+Math.imul(j,$)|0,o=o+Math.imul(j,H)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(k,X)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(T,rt)|0,i=(i=i+Math.imul(T,nt)|0)+Math.imul(x,rt)|0,o=o+Math.imul(x,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var Tt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,$),i=(i=Math.imul(G,H))+Math.imul(F,$)|0,o=Math.imul(F,H),n=n+Math.imul(C,X)|0,i=(i=i+Math.imul(C,W)|0)+Math.imul(j,X)|0,o=o+Math.imul(j,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(k,Q)|0,o=o+Math.imul(k,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(T,ot)|0,i=(i=i+Math.imul(T,st)|0)+Math.imul(x,ot)|0,o=o+Math.imul(x,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var xt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,X),i=(i=Math.imul(G,W))+Math.imul(F,X)|0,o=Math.imul(F,W),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(k,rt)|0,o=o+Math.imul(k,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(T,at)|0,i=(i=i+Math.imul(T,ht)|0)+Math.imul(x,at)|0,o=o+Math.imul(x,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(F,Q)|0,o=Math.imul(F,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(k,ot)|0,o=o+Math.imul(k,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(T,ct)|0,i=(i=i+Math.imul(T,ft)|0)+Math.imul(x,ct)|0,o=o+Math.imul(x,ft)|0;var Ot=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(F,rt)|0,o=Math.imul(F,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(k,at)|0,o=o+Math.imul(k,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,ft)|0;var St=(h+(n=n+Math.imul(T,pt)|0)|0)+((8191&(i=(i=i+Math.imul(T,mt)|0)+Math.imul(x,pt)|0))<<13)|0;h=((o=o+Math.imul(x,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(F,ot)|0,o=Math.imul(F,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(k,ct)|0,o=o+Math.imul(k,ft)|0;var Rt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(F,at)|0,o=Math.imul(F,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(k,pt)|0))<<13)|0;h=((o=o+Math.imul(k,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(F,ct)|0,o=Math.imul(F,ft);var kt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863;var Lt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(F,pt)|0))<<13)|0;return h=((o=Math.imul(F,mt))+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=Tt,a[11]=xt,a[12]=It,a[13]=Ot,a[14]=St,a[15]=Rt,a[16]=Pt,a[17]=kt,a[18]=Lt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(5),o=r(2),s=r(17),u=r(46);function a(t){return t.kind==o.OrderActionKind.CREATE_ASSET?"00":"01"}function h(t,e){return e.kind==o.OrderActionKind.TRANSFER_VALUE?u.OrderGatewayProxy.TOKEN_TRANSFER:e.kind==o.OrderActionKind.TRANSFER_ASSET?-1===t.provider.unsafeRecipientIds.indexOf(e.ledgerId)?u.OrderGatewayProxy.NFTOKEN_SAFE_TRANSFER:u.OrderGatewayProxy.NFTOKEN_TRANSFER:u.OrderGatewayProxy.XCERT_CREATE}function l(t){return t.kind==o.OrderActionKind.CREATE_ASSET?d(`0x${t.assetImprint}`,64):`${t.senderId}000000000000000000000000`}function c(t){return p(i.bigNumberify(t.assetId||t.value).toHexString(),64,"0",!0)}function f(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")}function p(t,e,r,n){const i=void 0===n?/^0x/i.test(t)||"number"==typeof t:n,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+t}e.createOrderHash=function(t,e){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of e.actions)r=s.keccak256(f(["0x",r.substr(2),a(n),`0000000${h(t,n)}`,n.ledgerId.substr(2),l(n).substr(2),n.receiverId.substr(2),c(n).substr(2)].join("")));return s.keccak256(f(["0x",t.id.substr(2),e.makerId.substr(2),e.takerId.substr(2),r.substr(2),p(s.toInteger(e.seed),64,"0",!1),p(s.toSeconds(e.expiration),64,"0",!1)].join("")))},e.createRecipeTuple=function(t,e){const r=e.actions.map(e=>({kind:a(e),proxy:h(t,e),token:e.ledgerId,param1:l(e),to:e.receiverId,value:c(e)})),n={from:e.makerId,to:e.takerId,actions:r,seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(n)},e.createSignatureTuple=function(t){const[e,r]=t.split(":"),i=parseInt(e)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:e,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)},e.getActionKind=a,e.getActionProxy=h,e.getActionParam1=l,e.getActionValue=c,e.hexToBytes=f,e.rightPad=d,e.leftPad=p,e.normalizeOrderIds=function(t,e){return(t=JSON.parse(JSON.stringify(t))).makerId=e.encoder.normalizeAddress(t.makerId),t.takerId=e.encoder.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=e.encoder.normalizeAddress(t.ledgerId),t.receiverId=e.encoder.normalizeAddress(t.receiverId),t.senderId=e.encoder.normalizeAddress(t.senderId)}),t}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,x,I,O,S,R,P,k,L,C,j,U,G,F,D,B,V,z,Z,q,K,$,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],$=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,x=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,B=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~x&O,t[11]=T^~I&S,t[20]=C^~U&F,t[21]=j^~G&D,t[30]=q^~$&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=x^~O&R,t[13]=I^~S&P,t[22]=U^~F&B,t[23]=G^~D&V,t[32]=$^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&k,t[15]=S^~P&L,t[24]=F^~B&z,t[25]=D^~V&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~k&N,t[17]=P^~L&T,t[26]=B^~z&C,t[27]=V^~Z&j,t[36]=W^~Q&q,t[37]=Y^~tt&K,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=k^~N&x,t[19]=L^~T&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&$,t[39]=tt^~K&H,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.5.7 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2016 + * @license MIT + */ +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,T,x,I,O,S,R,P,k,L,C,j,U,G,F,D,B,V,z,Z,q,K,$,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],$=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,L=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,T=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,F=t[26]<<25|t[27]>>>7,D=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,x=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,B=t[38]<<8|t[39]>>>24,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~x&O,t[11]=T^~I&S,t[20]=C^~U&F,t[21]=j^~G&D,t[30]=q^~$&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=x^~O&R,t[13]=I^~S&P,t[22]=U^~F&B,t[23]=G^~D&V,t[32]=$^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&k,t[15]=S^~P&L,t[24]=F^~B&z,t[25]=D^~V&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~k&N,t[17]=P^~L&T,t[26]=B^~z&C,t[27]=V^~Z&j,t[36]=W^~Q&q,t[37]=Y^~tt&K,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=k^~N&x,t[19]=L^~T&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&$,t[39]=tt^~K&H,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.XCERT_CREATE=0]="XCERT_CREATE",t[t.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",t[t.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",t[t.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER"}(e.OrderGatewayProxy||(e.OrderGatewayProxy={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(75)),n(r(46))},,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s=r(76),u=r(77),a=r(78),h=r(79),l=r(80),c=r(81),f=r(82);e.OrderGateway=class{static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e||t.orderGatewayId)}get id(){return this._id}get provider(){return this._provider}claim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?h.default(this,t):a.default(this,t)})}perform(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),u.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),s.default(this,t)})}getProxyAccountId(t){return n(this,void 0,void 0,function*(){return c.default(this,t)})}isValidSignature(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),f.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),l.default(this,t)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x36d63aca",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=o.createRecipeTuple(t,e),n={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x8b1d8335",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=o.createRecipeTuple(t,e),a=o.createSignatureTuple(r),h={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[n,a]).substr(2)},l=yield t.provider.post({method:"eth_sendTransaction",params:[h]});return new i.Mutation(t.provider,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"eth_sign",params:[t.provider.accountId,r]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"personal_sign",params:[r,t.provider.accountId,null]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0xd1c87f30",s=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"],u=["bytes32"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createRecipeTuple(t,e);try{const e={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xabd90f85",o=["uint8"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0x8fa76d8d",s=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],u=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=i.createOrderHash(t,e),a=i.createSignatureTuple(r);try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e.makerId,n,a]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]}catch(t){return null}})}},,,,,,,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(48);e.OrderActionKind=n.OrderActionKind,e.Order=n.Order,e.OrderGatewayProxy=n.OrderGatewayProxy,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(100))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(48);e.OrderGateway=class extends n.OrderGateway{}},,,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(99))}]); \ No newline at end of file diff --git a/dist/0xcert-wanchain-value-ledger.min.js b/dist/0xcert-wanchain-value-ledger.min.js new file mode 100644 index 000000000..db34150e3 --- /dev/null +++ b/dist/0xcert-wanchain-value-ledger.min.js @@ -0,0 +1,10 @@ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=120)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+l[15&a])}return"0x"+o.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 d(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 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,e+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=d,e.joinSignature=function(t){return c(a([(t=d(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function h(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var l={},c=0;c<10;c++)l[String(c)]=String(c);for(c=0;c<26;c++)l[String.fromCharCode(65+c)]=String(10+c);var f,d=Math.floor((f=9007199254740991,Math.log10?Math.log10(f):Math.log(f)/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>=d;){var r=e.substring(0,d);e=parseInt(r,10)%97+e.substring(r.length)}for(var n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function m(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.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&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=h("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=m,e.getIcapAddress=function(t){for(var e=new i.default.BN(m(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 m("0x"+s.keccak256(u.encode([m(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),h=r(40),l=r(11),c=o(r(3)),f=new RegExp(/^bytes([0-9]*)$/),d=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(d);return r&&parseInt(r[2])<=48?e.toNumber():e};var m=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),v=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(m);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");U(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var M=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),_=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 i(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}(M),b=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(M),E=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){c.throwError("invalid number value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){c.throwError("invalid "+this.name+" value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||c.throwError("expected array value",c.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=A.encode(e)),c.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&c.throwError("invalid "+r[1]+" bit length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new E(t,i/8,"int"===r[1],e.name);if(r=e.type.match(f))return(0===(i=parseInt(r[1]))||i>32)&&c.throwError("invalid bytes length",c.INVALID_ARGUMENT,{arg:"param",value:e}),new x(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=l.jsonCopy(e)).type=r[1],new C(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new j(t,n,r)}(t,e.components,e.name):""===e.type?new b(t,e.name):(c.throwError("invalid type",c.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var B=function(){function t(r){c.checkNew(this,t),r||(r=e.defaultCoerceFunc),l.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&c.throwError("types/values length mismatch",c.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new j(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):l.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new j(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=B,e.defaultAbiCoder=new B},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,h=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 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"],l=[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 n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,c=67108863&a,f=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=f;d++){var p=h-d|0;l+=(s=(i=0|t.words[p])*(o=0|e.words[d])+c)/67108864|0,c=67108863&s}r.words[h]=0|c,a=0|l}return 0!==a?r.words[h]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?h[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 f=l[t],d=c[t];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(d).toString(t);r=(p=p.idivn(d)).isZero()?m+r:h[f-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,h=new t(o),l=this.clone();if(a){for(u=0;!l.isZero();u++)s=l.andln(255),l.iushrn(8),h[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,d=0|s[1],p=8191&d,m=d>>>13,v=0|s[2],y=8191&v,g=v>>>13,w=0|s[3],M=8191&w,_=w>>>13,b=0|s[4],E=8191&b,A=b>>>13,N=0|s[5],x=8191&N,T=N>>>13,I=0|s[6],O=8191&I,S=I>>>13,R=0|s[7],P=8191&R,L=R>>>13,k=0|s[8],C=8191&k,j=k>>>13,U=0|s[9],G=8191&U,D=U>>>13,B=0|u[0],F=8191&B,V=B>>>13,z=0|u[1],Z=8191&z,q=z>>>13,$=0|u[2],H=8191&$,K=$>>>13,J=0|u[3],W=8191&J,X=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ht=ut>>>13,lt=0|u[8],ct=8191<,ft=lt>>>13,dt=0|u[9],pt=8191&dt,mt=dt>>>13;r.negative=t.negative^e.negative,r.length=19;var vt=(h+(n=Math.imul(c,F))|0)+((8191&(i=(i=Math.imul(c,V))+Math.imul(f,F)|0))<<13)|0;h=((o=Math.imul(f,V))+(i>>>13)|0)+(vt>>>26)|0,vt&=67108863,n=Math.imul(p,F),i=(i=Math.imul(p,V))+Math.imul(m,F)|0,o=Math.imul(m,V);var yt=(h+(n=n+Math.imul(c,Z)|0)|0)+((8191&(i=(i=i+Math.imul(c,q)|0)+Math.imul(f,Z)|0))<<13)|0;h=((o=o+Math.imul(f,q)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,F),i=(i=Math.imul(y,V))+Math.imul(g,F)|0,o=Math.imul(g,V),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;var gt=(h+(n=n+Math.imul(c,H)|0)|0)+((8191&(i=(i=i+Math.imul(c,K)|0)+Math.imul(f,H)|0))<<13)|0;h=((o=o+Math.imul(f,K)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(M,F),i=(i=Math.imul(M,V))+Math.imul(_,F)|0,o=Math.imul(_,V),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,q)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,q)|0,n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,K)|0;var wt=(h+(n=n+Math.imul(c,W)|0)|0)+((8191&(i=(i=i+Math.imul(c,X)|0)+Math.imul(f,W)|0))<<13)|0;h=((o=o+Math.imul(f,X)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(E,F),i=(i=Math.imul(E,V))+Math.imul(A,F)|0,o=Math.imul(A,V),n=n+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,q)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,q)|0,n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(g,H)|0,o=o+Math.imul(g,K)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0;var Mt=(h+(n=n+Math.imul(c,Q)|0)|0)+((8191&(i=(i=i+Math.imul(c,tt)|0)+Math.imul(f,Q)|0))<<13)|0;h=((o=o+Math.imul(f,tt)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(x,F),i=(i=Math.imul(x,V))+Math.imul(T,F)|0,o=Math.imul(T,V),n=n+Math.imul(E,Z)|0,i=(i=i+Math.imul(E,q)|0)+Math.imul(A,Z)|0,o=o+Math.imul(A,q)|0,n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,K)|0)+Math.imul(_,H)|0,o=o+Math.imul(_,K)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,o=o+Math.imul(g,X)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(m,Q)|0,o=o+Math.imul(m,tt)|0;var _t=(h+(n=n+Math.imul(c,rt)|0)|0)+((8191&(i=(i=i+Math.imul(c,nt)|0)+Math.imul(f,rt)|0))<<13)|0;h=((o=o+Math.imul(f,nt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(O,F),i=(i=Math.imul(O,V))+Math.imul(S,F)|0,o=Math.imul(S,V),n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,q)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,q)|0,n=n+Math.imul(E,H)|0,i=(i=i+Math.imul(E,K)|0)+Math.imul(A,H)|0,o=o+Math.imul(A,K)|0,n=n+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(_,W)|0,o=o+Math.imul(_,X)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(m,rt)|0,o=o+Math.imul(m,nt)|0;var bt=(h+(n=n+Math.imul(c,ot)|0)|0)+((8191&(i=(i=i+Math.imul(c,st)|0)+Math.imul(f,ot)|0))<<13)|0;h=((o=o+Math.imul(f,st)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(P,F),i=(i=Math.imul(P,V))+Math.imul(L,F)|0,o=Math.imul(L,V),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,q)|0)+Math.imul(S,Z)|0,o=o+Math.imul(S,q)|0,n=n+Math.imul(x,H)|0,i=(i=i+Math.imul(x,K)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,K)|0,n=n+Math.imul(E,W)|0,i=(i=i+Math.imul(E,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,n=n+Math.imul(M,Q)|0,i=(i=i+Math.imul(M,tt)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(m,ot)|0,o=o+Math.imul(m,st)|0;var Et=(h+(n=n+Math.imul(c,at)|0)|0)+((8191&(i=(i=i+Math.imul(c,ht)|0)+Math.imul(f,at)|0))<<13)|0;h=((o=o+Math.imul(f,ht)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(C,F),i=(i=Math.imul(C,V))+Math.imul(j,F)|0,o=Math.imul(j,V),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,q)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,q)|0,n=n+Math.imul(O,H)|0,i=(i=i+Math.imul(O,K)|0)+Math.imul(S,H)|0,o=o+Math.imul(S,K)|0,n=n+Math.imul(x,W)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,n=n+Math.imul(E,Q)|0,i=(i=i+Math.imul(E,tt)|0)+Math.imul(A,Q)|0,o=o+Math.imul(A,tt)|0,n=n+Math.imul(M,rt)|0,i=(i=i+Math.imul(M,nt)|0)+Math.imul(_,rt)|0,o=o+Math.imul(_,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ht)|0)+Math.imul(m,at)|0,o=o+Math.imul(m,ht)|0;var At=(h+(n=n+Math.imul(c,ct)|0)|0)+((8191&(i=(i=i+Math.imul(c,ft)|0)+Math.imul(f,ct)|0))<<13)|0;h=((o=o+Math.imul(f,ft)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(G,F),i=(i=Math.imul(G,V))+Math.imul(D,F)|0,o=Math.imul(D,V),n=n+Math.imul(C,Z)|0,i=(i=i+Math.imul(C,q)|0)+Math.imul(j,Z)|0,o=o+Math.imul(j,q)|0,n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(L,H)|0,o=o+Math.imul(L,K)|0,n=n+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,n=n+Math.imul(x,Q)|0,i=(i=i+Math.imul(x,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(E,rt)|0,i=(i=i+Math.imul(E,nt)|0)+Math.imul(A,rt)|0,o=o+Math.imul(A,nt)|0,n=n+Math.imul(M,ot)|0,i=(i=i+Math.imul(M,st)|0)+Math.imul(_,ot)|0,o=o+Math.imul(_,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ht)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ht)|0,n=n+Math.imul(p,ct)|0,i=(i=i+Math.imul(p,ft)|0)+Math.imul(m,ct)|0,o=o+Math.imul(m,ft)|0;var Nt=(h+(n=n+Math.imul(c,pt)|0)|0)+((8191&(i=(i=i+Math.imul(c,mt)|0)+Math.imul(f,pt)|0))<<13)|0;h=((o=o+Math.imul(f,mt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(G,Z),i=(i=Math.imul(G,q))+Math.imul(D,Z)|0,o=Math.imul(D,q),n=n+Math.imul(C,H)|0,i=(i=i+Math.imul(C,K)|0)+Math.imul(j,H)|0,o=o+Math.imul(j,K)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,X)|0)+Math.imul(L,W)|0,o=o+Math.imul(L,X)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(S,Q)|0,o=o+Math.imul(S,tt)|0,n=n+Math.imul(x,rt)|0,i=(i=i+Math.imul(x,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(E,ot)|0,i=(i=i+Math.imul(E,st)|0)+Math.imul(A,ot)|0,o=o+Math.imul(A,st)|0,n=n+Math.imul(M,at)|0,i=(i=i+Math.imul(M,ht)|0)+Math.imul(_,at)|0,o=o+Math.imul(_,ht)|0,n=n+Math.imul(y,ct)|0,i=(i=i+Math.imul(y,ft)|0)+Math.imul(g,ct)|0,o=o+Math.imul(g,ft)|0;var xt=(h+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,mt)|0)+Math.imul(m,pt)|0))<<13)|0;h=((o=o+Math.imul(m,mt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(G,H),i=(i=Math.imul(G,K))+Math.imul(D,H)|0,o=Math.imul(D,K),n=n+Math.imul(C,W)|0,i=(i=i+Math.imul(C,X)|0)+Math.imul(j,W)|0,o=o+Math.imul(j,X)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(S,rt)|0,o=o+Math.imul(S,nt)|0,n=n+Math.imul(x,ot)|0,i=(i=i+Math.imul(x,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(E,at)|0,i=(i=i+Math.imul(E,ht)|0)+Math.imul(A,at)|0,o=o+Math.imul(A,ht)|0,n=n+Math.imul(M,ct)|0,i=(i=i+Math.imul(M,ft)|0)+Math.imul(_,ct)|0,o=o+Math.imul(_,ft)|0;var Tt=(h+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,mt)|0)+Math.imul(g,pt)|0))<<13)|0;h=((o=o+Math.imul(g,mt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(G,W),i=(i=Math.imul(G,X))+Math.imul(D,W)|0,o=Math.imul(D,X),n=n+Math.imul(C,Q)|0,i=(i=i+Math.imul(C,tt)|0)+Math.imul(j,Q)|0,o=o+Math.imul(j,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(S,ot)|0,o=o+Math.imul(S,st)|0,n=n+Math.imul(x,at)|0,i=(i=i+Math.imul(x,ht)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ht)|0,n=n+Math.imul(E,ct)|0,i=(i=i+Math.imul(E,ft)|0)+Math.imul(A,ct)|0,o=o+Math.imul(A,ft)|0;var It=(h+(n=n+Math.imul(M,pt)|0)|0)+((8191&(i=(i=i+Math.imul(M,mt)|0)+Math.imul(_,pt)|0))<<13)|0;h=((o=o+Math.imul(_,mt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(G,Q),i=(i=Math.imul(G,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(C,rt)|0,i=(i=i+Math.imul(C,nt)|0)+Math.imul(j,rt)|0,o=o+Math.imul(j,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ht)|0)+Math.imul(S,at)|0,o=o+Math.imul(S,ht)|0,n=n+Math.imul(x,ct)|0,i=(i=i+Math.imul(x,ft)|0)+Math.imul(T,ct)|0,o=o+Math.imul(T,ft)|0;var Ot=(h+(n=n+Math.imul(E,pt)|0)|0)+((8191&(i=(i=i+Math.imul(E,mt)|0)+Math.imul(A,pt)|0))<<13)|0;h=((o=o+Math.imul(A,mt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(G,rt),i=(i=Math.imul(G,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(C,ot)|0,i=(i=i+Math.imul(C,st)|0)+Math.imul(j,ot)|0,o=o+Math.imul(j,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ht)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ht)|0,n=n+Math.imul(O,ct)|0,i=(i=i+Math.imul(O,ft)|0)+Math.imul(S,ct)|0,o=o+Math.imul(S,ft)|0;var St=(h+(n=n+Math.imul(x,pt)|0)|0)+((8191&(i=(i=i+Math.imul(x,mt)|0)+Math.imul(T,pt)|0))<<13)|0;h=((o=o+Math.imul(T,mt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(G,ot),i=(i=Math.imul(G,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(C,at)|0,i=(i=i+Math.imul(C,ht)|0)+Math.imul(j,at)|0,o=o+Math.imul(j,ht)|0,n=n+Math.imul(P,ct)|0,i=(i=i+Math.imul(P,ft)|0)+Math.imul(L,ct)|0,o=o+Math.imul(L,ft)|0;var Rt=(h+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,mt)|0)+Math.imul(S,pt)|0))<<13)|0;h=((o=o+Math.imul(S,mt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(G,at),i=(i=Math.imul(G,ht))+Math.imul(D,at)|0,o=Math.imul(D,ht),n=n+Math.imul(C,ct)|0,i=(i=i+Math.imul(C,ft)|0)+Math.imul(j,ct)|0,o=o+Math.imul(j,ft)|0;var Pt=(h+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,mt)|0)+Math.imul(L,pt)|0))<<13)|0;h=((o=o+Math.imul(L,mt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(G,ct),i=(i=Math.imul(G,ft))+Math.imul(D,ct)|0,o=Math.imul(D,ft);var Lt=(h+(n=n+Math.imul(C,pt)|0)|0)+((8191&(i=(i=i+Math.imul(C,mt)|0)+Math.imul(j,pt)|0))<<13)|0;h=((o=o+Math.imul(j,mt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var kt=(h+(n=Math.imul(G,pt))|0)+((8191&(i=(i=Math.imul(G,mt))+Math.imul(D,pt)|0))<<13)|0;return h=((o=Math.imul(D,mt))+(i>>>13)|0)+(kt>>>26)|0,kt&=67108863,a[0]=vt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=Mt,a[5]=_t,a[6]=bt,a[7]=Et,a[8]=At,a[9]=Nt,a[10]=xt,a[11]=Tt,a[12]=It,a[13]=Ot,a[14]=St,a[15]=Rt,a[16]=Pt,a[17]=Lt,a[18]=kt,0!==h&&(a[19]=h,r.length++),r};function p(t,e,r){return(new m).mulp(t,e,r)}function m(t,e){this.x=t,this.y=e}Math.imul||(d=f),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?d(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 n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,t,e):p(this,t,e)},m.prototype.makeRBT=function(t){for(var e=new Array(t),r=o.prototype._countBits(t)-1,n=0;n>=1;return n},m.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,h=0;h=0&&(0!==l||h>=i);h--){var c=0|this.words[h];this.words[h]=l<<26-o|c>>>o,l=c&u}return a&&0!==l&&(a.words[a.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var h=0;h=0;c--){var f=67108864*(0|n.words[i.length+c])+(0|n.words[i.length+c-1]);for(f=Math.min(f/s|0,67108863),n._ishlnsubmul(i,f,c);0!==n.negative;)f--,n.negative=0,n._ishlnsubmul(i,1,c),n.isZero()||(n.negative^=1);u&&(u.words[c]=f)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),h=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++h;for(var l=r.clone(),c=e.clone();!e.isZero();){for(var f=0,d=1;0==(e.words[0]&d)&&f<26;++f,d<<=1);if(f>0)for(e.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(c)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(u.isOdd()||a.isOdd())&&(u.iadd(l),a.isub(c)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(h)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=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(a),s.iushrn(1);for(var c=0,f=1;0==(r.words[0]&f)&&c<26;++c,f<<=1);if(c>0)for(r.iushrn(c);c-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 b(t)},o.prototype.toRed=function(t){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function M(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){y.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function b(t){if("string"==typeof t){var e=o._prime(t);this.m=e.p,this.prime=e}else n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function E(t){b.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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}return 0!==e&&(t.words[t.length++]=e),t},o._prime=function(t){if(v[t])return v[t];var e;if("k256"===t)e=new g;else if("p224"===t)e=new w;else if("p192"===t)e=new M;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new _}return v[t]=e,e},b.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},b.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(t.red&&t.red===e.red,"red works only with red numbers")},b.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):t.umod(this.m)._forceRed(this)},b.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},b.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)},b.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},b.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)},b.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return r.cmpn(0)<0&&r.iadd(this.m),r},b.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},b.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},b.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},b.prototype.isqr=function(t){return this.imul(t,t.clone())},b.prototype.sqr=function(t){return this.mul(t,t)},b.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.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(a);)l.redIAdd(a);for(var c=this.pow(l,i),f=this.pow(t,i.addn(1).iushrn(1)),d=this.pow(t,i),p=s;0!==d.cmp(u);){for(var m=d,v=0;0!==m.cmp(u);v++)m=m.redSqr();n(v=0;n--){for(var h=e.words[n],l=a-1;l>=0;l--){var c=h>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==c||0!==s?(s<<=1,s|=c,(4===++u||0===n&&0===l)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},b.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},b.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},o.mont=function(t){return new E(t)},i(E,b),E.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},E.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},E.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},E.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},E.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),h=r(11),l=r(39),c=s(r(3)),f=new u.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 p(t){return y(t)._bn}function m(t){return new v(d(t))}var v=function(t){function e(r){var n=t.call(this)||this;if(c.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),h.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?h.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))):c.throwError("invalid BigNumber string value",c.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&c.throwError("underflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{h.defineReadOnly(n,"_hex",d(new u.default.BN(r)))}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?h.defineReadOnly(n,"_hex",r._hex):r.toHexString?h.defineReadOnly(n,"_hex",d(p(r.toHexString()))):a.isArrayish(r)?h.defineReadOnly(n,"_hex",d(new u.default.BN(a.hexlify(r).substring(2),16))):c.throwError("invalid BigNumber value",c.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(f):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return m(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return m(this._bn.toTwos(t))},e.prototype.add=function(t){return m(this._bn.add(p(t)))},e.prototype.sub=function(t){return m(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&c.throwError("division by zero",c.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),m(this._bn.div(p(t)))},e.prototype.mul=function(t){return m(this._bn.mul(p(t)))},e.prototype.mod=function(t){return m(this._bn.mod(p(t)))},e.prototype.pow=function(t){return m(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return m(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){c.throwError("overflow",c.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(l.BigNumber);function y(t){return t instanceof v?t:new v(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function h(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function l(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=h(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function c(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var h=a.length,l=p(a,h);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return f(this,t,!0)},u.prototype.rawListeners=function(t){return f(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},u.prototype.listenerCount=d,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},,function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,x,T,I,O,S,R,P,L,k,C,j,U,G,D,B,F,V,z,Z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(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=u^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|s>>>31),r=f^(s<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,T=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~T&O,t[11]=x^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=T^~O&R,t[13]=I^~S&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&z,t[25]=B^~V&Z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&x,t[26]=F^~z&C,t[27]=V^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&T,t[19]=k^~x&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,h=t.blockCount<<2,l=t.blockCount,c=t.outputBlocks,f=t.s,d=0;d>2]|=e[d]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[v>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=h){for(t.start=v-h,t.block=a[l],v=0;v>2]|=n[3&v],t.lastByteIndex===h)for(a[0]=a[l],v=1;v>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%l==0&&(s(f),v=0)}return"0x"+m})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.5.7 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2016 + * @license MIT + */ +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],h=["hex","buffer","arrayBuffer","array"],l=function(t,e,r){return function(n){return new _(t,e,t).update(n)[r]()}},c=function(t,e,r){return function(n,i){return new _(t,e,i).update(n)[r]()}},f=function(t,e){var r=l(t,e,"hex");r.create=function(){return new _(t,e,t)},r.update=function(t){return r.create().update(t)};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}_.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,h=0,l=this.s;h>2]|=t[h]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(b(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},_.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&b(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var b=function(t){var e,r,n,i,o,s,a,h,l,c,f,d,p,m,v,y,g,w,M,_,b,E,A,N,x,T,I,O,S,R,P,L,k,C,j,U,G,D,B,F,V,z,Z,q,$,H,K,J,W,X,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ht,lt;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=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],c=t[6]^t[16]^t[26]^t[36]^t[46],f=t[7]^t[17]^t[27]^t[37]^t[47],e=(d=t[8]^t[18]^t[28]^t[38]^t[48])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(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=s^(c<<1|f>>>31),r=a^(f<<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^(d<<1|p>>>31),r=l^(p<<1|d>>>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^(i<<1|o>>>31),r=f^(o<<1|i>>>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,m=t[0],v=t[1],H=t[11]<<4|t[10]>>>28,K=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,S=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,z=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,C=t[2]<<1|t[3]>>>31,j=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,R=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,U=t[14]<<6|t[15]>>>26,G=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,M=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,k=t[44]<<29|t[45]>>>3,N=t[6]<<28|t[7]>>>4,x=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,B=t[27]<<25|t[26]>>>7,_=t[36]<<21|t[37]>>>11,b=t[37]<<21|t[36]>>>11,Q=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,q=t[8]<<27|t[9]>>>5,$=t[9]<<27|t[8]>>>5,T=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,V=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,A=t[49]<<14|t[48]>>>18,t[0]=m^~y&w,t[1]=v^~g&M,t[10]=N^~T&O,t[11]=x^~I&S,t[20]=C^~U&D,t[21]=j^~G&B,t[30]=q^~H&J,t[31]=$^~K&W,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&_,t[3]=g^~M&b,t[12]=T^~O&R,t[13]=I^~S&P,t[22]=U^~D&F,t[23]=G^~B&V,t[32]=H^~J&X,t[33]=K^~W&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~_&E,t[5]=M^~b&A,t[14]=O^~R&L,t[15]=S^~P&k,t[24]=D^~F&z,t[25]=B^~V&Z,t[34]=J^~X&Q,t[35]=W^~Y&tt,t[44]=ot^~ut&ht,t[45]=st^~at<,t[6]=_^~E&m,t[7]=b^~A&v,t[16]=R^~L&N,t[17]=P^~k&x,t[26]=F^~z&C,t[27]=V^~Z&j,t[36]=X^~Q&q,t[37]=Y^~tt&$,t[46]=ut^~ht&et,t[47]=at^~lt&rt,t[8]=E^~m&y,t[9]=A^~v&g,t[18]=L^~N&T,t[19]=k^~x&I,t[28]=z^~C&U,t[29]=Z^~j&G,t[38]=Q^~q&H,t[39]=tt^~$&K,t[48]=ht^~et&nt,t[49]=lt^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(v=0;v1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(84))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(85),u=r(86),a=r(87),h=r(88),l=r(89),c=r(90),f=r(91);e.ValueLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return u.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),l.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),c.default(this,t)})}getInfo(){return n(this,void 0,void 0,function*(){return f.default(this)})}isApprovedValue(t,e,r){return n(this,void 0,void 0,function*(){"string"!=typeof r&&(r=yield r.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const n=yield l.default(this,e,r);return i.bigNumberify(n).gte(i.bigNumberify(t))})}approveValue(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!i.bigNumberify(t).isZero()&&!i.bigNumberify(r).isZero())throw new o.ProviderError(o.ProviderIssue.GENERAL,"First set approval to 0. ERC20 token potential attack.");return s.default(this,e,t)})}disapproveValue(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?h.default(this,e,r,t.value):a.default(this,r,t.value)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:u,supply:a}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.valueLedgerSource).then(t=>t.json())).TokenMock.evm.bytecode.object,h={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(s,[e,r,u,a]).substr(2)}`},l=yield t.post({method:"eth_sendTransaction",params:[h]});return new i.Mutation(t,l.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa9059cbb",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xdd62ed3e",o=["address","address"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.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 n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}})}},,,,,,,,,,function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(102))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(83);e.ValueLedger=class extends n.ValueLedger{}},,,,,,,,,,,,,,,,,,function(t,e,r){window.$0xcert=window.$0xcert||{},Object.assign(window.$0xcert,r(101))}]); \ No newline at end of file diff --git a/dist/0xcert-wanchain.min.js b/dist/0xcert-wanchain.min.js new file mode 100644 index 000000000..4835bc4d7 --- /dev/null +++ b/dist/0xcert-wanchain.min.js @@ -0,0 +1,10 @@ +!function(t){var e={};function r(n){if(e[n])return e[n].exports;var i=e[n]={i:n,l:!1,exports:{}};return t[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var i in t)r.d(n,i,function(e){return t[e]}.bind(null,i));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=122)}([function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(8)),n(r(7)),n(r(13)),n(r(43)),n(r(44)),n(r(15))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(3);function i(t){return!!t._bn}function o(t){return t.slice?t:(t.slice=function(){var e=Array.prototype.slice.call(arguments);return new Uint8Array(Array.prototype.slice.apply(t,e))},t)}function s(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}),i(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=[],u=0;u>4]+h[15&a])}return"0x"+o.join("")}return n.throwError("invalid hexlify value",null,{arg:"value",value:t}),"never"}function l(t,e){for(c(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 f(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=l(t.r,32),o=l(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=d(a.slice(0,32)),o=d(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=d,e.hexDataLength=function(t){return c(t)&&t.length%2==0?(t.length-2)/2:null},e.hexDataSlice=function(t,e,r){return c(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,e+2*r):"0x"+t.substring(e)},e.hexStripZeros=function(t){for(c(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=l,e.splitSignature=f,e.joinSignature=function(t){return d(a([(t=f(t)).r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(7)),n(r(30)),n(r(8)),n(r(18))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),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.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION";var n=!1,i=!1;function o(t,r,n){if(i)throw new Error("unknown error");r||(r=e.UNKNOWN_ERROR),n||(n={});var o=[];Object.keys(n).forEach(function(t){try{o.push(t+"="+JSON.stringify(n[t]))}catch(e){o.push(t+"="+JSON.stringify(n[t].toString()))}});var s=t;o.length&&(t+=" ("+o.join(", ")+")");var u=new Error(t);throw u.reason=s,u.code=r,Object.keys(n).forEach(function(t){u[t]=n[t]}),u}e.throwError=o,e.checkNew=function(t,r){t instanceof r||o("missing new",e.MISSING_NEW,{name:r.name})},e.checkArgumentCount=function(t,r,n){n||(n=""),tr&&o("too many arguments"+n,e.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})},e.setCensorship=function(t,r){n&&o("error censorship permanent",e.UNSUPPORTED_OPERATION,{operation:"setCersorship"}),i=!!t,n=!!r}},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var i=n(r(9)),o=r(1),s=r(34),u=r(38),a=r(3);function c(t){"string"==typeof t&&t.match(/^0x[0-9A-Fa-f]{40}$/)||a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});for(var e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=e[n].charCodeAt(0);r=o.arrayify(s.keccak256(r));for(var i=0;i<40;i+=2)r[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(15&r[i>>1])>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}for(var h={},d=0;d<10;d++)h[String(d)]=String(d);for(d=0;d<26;d++)h[String.fromCharCode(65+d)]=String(10+d);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 n=String(98-parseInt(e,10)%97);n.length<2;)n="0"+n;return n}function v(t){var e=null;if("string"!=typeof t&&a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t}),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=c(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&a.throwError("bad address checksum",a.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)&&a.throwError("bad icap checksum",a.INVALID_ARGUMENT,{arg:"address",value:t}),e=new i.default.BN(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=c("0x"+e)}else a.throwError("invalid address",a.INVALID_ARGUMENT,{arg:"address",value:t});return e}e.getAddress=v,e.getIcapAddress=function(t){for(var e=new i.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(u.encode([v(t.from),o.stripZeros(o.hexlify(e))])).substring(26))}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(31)),n(r(12)),n(r(41)),n(r(42))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(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(4),u=r(10),a=r(1),c=r(40),h=r(11),d=o(r(3)),l=new RegExp(/^bytes([0-9]*)$/),f=new RegExp(/^(u?int)([0-9]*)$/),p=new RegExp(/^(.*)\[([0-9]*)\]$/);e.defaultCoerceFunc=function(t,e){var r=t.match(f);return r&&parseInt(r[2])<=48?e.toNumber():e};var v=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),m=new RegExp("^[A-Za-z_][A-Za-z0-9_]*$");function y(t){return t.match(/^uint($|[^1-9])/)?t="uint256"+t.substring(4):t.match(/^int($|[^1-9])/)&&(t="int256"+t.substring(3)),t}function g(t,e){function r(e){throw new Error('unexpected character "'+t[e]+'" at position '+e+' in "'+t+'"')}for(var n={type:"",name:"",state:{allowType:!0}},i=n,o=0;o1){var i=r[1].match(v);if(""!=i[1].trim()||""!=i[3].trim())throw new Error("unexpected tokens");G(i[2]).forEach(function(t){e.outputs.push(g(t))})}return e}(t.trim()));throw new Error("unknown signature")};var _=function(){return function(t,e,r,n,i){this.coerceFunc=t,this.name=e,this.type=r,this.localName=n,this.dynamic=i}}(),b=function(t){function e(e){var r=t.call(this,e.coerceFunc,e.name,e.type,void 0,e.dynamic)||this;return h.defineReadOnly(r,"coder",e),r}return i(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}(_),M=function(t){function e(e,r){return t.call(this,e,"null","",r,!1)||this}return i(e,t),e.prototype.encode=function(t){return a.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}(_),A=function(t){function e(e,r,n,i){var o=this,s=(n?"int":"uint")+8*r;return(o=t.call(this,e,s,s,i,!1)||this).size=r,o.signed=n,o}return i(e,t),e.prototype.encode=function(t){try{var e=u.bigNumberify(t);return e=e.toTwos(8*this.size).maskn(8*this.size),this.signed&&(e=e.fromTwos(8*this.size).toTwos(256)),a.padZeros(a.arrayify(e),32)}catch(e){d.throwError("invalid number value",d.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:t})}return null},e.prototype.decode=function(t,e){t.length32)throw new Error;e.set(r)}catch(e){d.throwError("invalid "+this.name+" value",d.INVALID_ARGUMENT,{arg:this.localName,coderType:this.name,value:e.value||t})}return e},e.prototype.decode=function(t,e){return t.length=0?n:"")+"]",u=-1===n||r.dynamic;return(o=t.call(this,e,"array",s,i,u)||this).coder=r,o.length=n,o}return i(e,t),e.prototype.encode=function(t){Array.isArray(t)||d.throwError("expected array value",d.INVALID_ARGUMENT,{arg:this.localName,coderType:"array",value:t});var e=this.length,r=new Uint8Array(0);-1===e&&(e=t.length,r=E.encode(e)),d.checkArgumentCount(e,t.length,"in coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i256||i%8!=0)&&d.throwError("invalid "+r[1]+" bit length",d.INVALID_ARGUMENT,{arg:"param",value:e}),new A(t,i/8,"int"===r[1],e.name);if(r=e.type.match(l))return(0===(i=parseInt(r[1]))||i>32)&&d.throwError("invalid bytes length",d.INVALID_ARGUMENT,{arg:"param",value:e}),new P(t,i,e.name);if(r=e.type.match(p)){var i=parseInt(r[2]||"-1");return(e=h.jsonCopy(e)).type=r[1],new k(t,D(t,e),i,e.name)}return"tuple"===e.type.substring(0,5)?function(t,e,r){e||(e=[]);var n=[];return e.forEach(function(e){n.push(D(t,e))}),new C(t,n,r)}(t,e.components,e.name):""===e.type?new M(t,e.name):(d.throwError("invalid type",d.INVALID_ARGUMENT,{arg:"type",value:e.type}),null)}var F=function(){function t(r){d.checkNew(this,t),r||(r=e.defaultCoerceFunc),h.defineReadOnly(this,"coerceFunc",r)}return t.prototype.encode=function(t,e){t.length!==e.length&&d.throwError("types/values length mismatch",d.INVALID_ARGUMENT,{count:{types:t.length,values:e.length},value:{types:t,values:e}});var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):t,r.push(D(this.coerceFunc,e))},this),a.hexlify(new C(this.coerceFunc,r,"_").encode(e))},t.prototype.decode=function(t,e){var r=[];return t.forEach(function(t){var e=null;e="string"==typeof t?g(t):h.jsonCopy(t),r.push(D(this.coerceFunc,e))},this),new C(this.coerceFunc,r,"_").decode(a.arrayify(e),0).value},t}();e.AbiCoder=F,e.defaultAbiCoder=new F},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.ACCOUNT_CHANGE="accountChanged",t.NETWORK_CHANGE="networkChanged"}(e.ProviderEvent||(e.ProviderEvent={})),function(t){t[t.GENERAL=0]="GENERAL"}(e.ProviderIssue||(e.ProviderIssue={}));e.ProviderError=class extends Error{constructor(t,e){super(),this.name="ProviderError",this.issue=t,this.original=e,this.message=`GenericProvider error [issue: ${t}]`,Error.captureStackTrace&&Error.captureStackTrace(this,this.constructor)}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t.COMPLETE="complete",t.CONFIRM="confirm",t.ERROR="error"}(e.MutationEvent||(e.MutationEvent={}))},function(t,e,r){(function(t){!function(t,e){"use strict";function n(t,e){if(!t)throw new Error(e||"Assertion failed")}function i(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=r(33).Buffer}catch(t){}function u(t,e,r){for(var n=0,i=Math.min(t.length,r),o=e;o=49&&s<=54?s-49+10:s>=17&&s<=22?s-17+10:15&s}return n}function a(t,e,r,n){for(var i=0,o=Math.min(t.length,r),s=e;s=49?u-49+10:u>=17?u-17+10:u}return i}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),n(e===(0|e)&&e>=2&&e<=36);var i=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&i++,16===e?this._parseHex(t,i):this._parseBase(t,e,i),"-"===t[0]&&(this.negative=1),this.strip(),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initNumber=function(t,e,r){t<0&&(this.negative=1,t=-t),t<67108864?(this.words=[67108863&t],this.length=1):t<4503599627370496?(this.words=[67108863&t,t/67108864&67108863],this.length=2):(n(t<9007199254740992),this.words=[67108863&t,t/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),e,r)},o.prototype._initArray=function(t,e,r){if(n("number"==typeof t.length),t.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(t.length/3),this.words=new Array(this.length);for(var i=0;i=0;i-=3)s=t[i]|t[i-1]<<8|t[i-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===r)for(i=0,o=0;i>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this.strip()},o.prototype._parseHex=function(t,e){this.length=Math.ceil((t.length-e)/6),this.words=new Array(this.length);for(var r=0;r=e;r-=6)i=u(t,r,r+6),this.words[n]|=i<>>26-o&4194303,(o+=24)>=26&&(o-=26,n++);r+6!==e&&(i=u(t,e,r+6),this.words[n]|=i<>>26-o&4194303),this.strip()},o.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=e)n++;n--,i=i/e|0;for(var o=t.length-r,s=o%n,u=Math.min(o,o-s)+r,c=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 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],d=[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 l(t,e,r){r.negative=e.negative^t.negative;var n=t.length+e.length|0;r.length=n,n=n-1|0;var i=0|t.words[0],o=0|e.words[0],s=i*o,u=67108863&s,a=s/67108864|0;r.words[0]=u;for(var c=1;c>>26,d=67108863&a,l=Math.min(c,e.length-1),f=Math.max(0,c-t.length+1);f<=l;f++){var p=c-f|0;h+=(s=(i=0|t.words[p])*(o=0|e.words[f])+d)/67108864|0,d=67108863&s}r.words[c]=0|d,a=0|h}return 0!==a?r.words[c]=0|a: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 i=0,o=0,s=0;s>>24-i&16777215)||s!==this.length-1?c[6-a.length]+a+r:a+r,(i+=2)>=26&&(i-=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 l=h[t],f=d[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:c[l-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%e!=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 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&&n(!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 n(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 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,u,a="le"===e,c=new t(o),h=this.clone();if(a){for(u=0;!h.isZero();u++)s=h.andln(255),h.iushrn(8),c[u]=s;for(;u=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 n=0;nt.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){n("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),r=t%26;this._expand(e),r>0&&e--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(t){return this.clone().inotn(t)},o.prototype.setn=function(t,e){n("number"==typeof t&&t>=0);var r=t/26|0,i=t%26;return this._expand(r+1),this.words[r]=e?this.words[r]|1<t.length?(r=this,n=t):(r=t,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(;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,n,i=this.cmp(t);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=t):(r=t,n=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,m=0|s[2],y=8191&m,g=m>>>13,w=0|s[3],_=8191&w,b=w>>>13,M=0|s[4],A=8191&M,E=M>>>13,x=0|s[5],P=8191&x,T=x>>>13,I=0|s[6],O=8191&I,N=I>>>13,S=0|s[7],R=8191&S,L=S>>>13,j=0|s[8],k=8191&j,C=j>>>13,G=0|s[9],U=8191&G,D=G>>>13,F=0|u[0],B=8191&F,z=F>>>13,V=0|u[1],Z=8191&V,$=V>>>13,K=0|u[2],q=8191&K,H=K>>>13,J=0|u[3],X=8191&J,W=J>>>13,Y=0|u[4],Q=8191&Y,tt=Y>>>13,et=0|u[5],rt=8191&et,nt=et>>>13,it=0|u[6],ot=8191&it,st=it>>>13,ut=0|u[7],at=8191&ut,ct=ut>>>13,ht=0|u[8],dt=8191&ht,lt=ht>>>13,ft=0|u[9],pt=8191&ft,vt=ft>>>13;r.negative=t.negative^e.negative,r.length=19;var mt=(c+(n=Math.imul(d,B))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(l,B)|0))<<13)|0;c=((o=Math.imul(l,z))+(i>>>13)|0)+(mt>>>26)|0,mt&=67108863,n=Math.imul(p,B),i=(i=Math.imul(p,z))+Math.imul(v,B)|0,o=Math.imul(v,z);var yt=(c+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,$)|0)+Math.imul(l,Z)|0))<<13)|0;c=((o=o+Math.imul(l,$)|0)+(i>>>13)|0)+(yt>>>26)|0,yt&=67108863,n=Math.imul(y,B),i=(i=Math.imul(y,z))+Math.imul(g,B)|0,o=Math.imul(g,z),n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,$)|0)+Math.imul(v,Z)|0,o=o+Math.imul(v,$)|0;var gt=(c+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,H)|0)+Math.imul(l,q)|0))<<13)|0;c=((o=o+Math.imul(l,H)|0)+(i>>>13)|0)+(gt>>>26)|0,gt&=67108863,n=Math.imul(_,B),i=(i=Math.imul(_,z))+Math.imul(b,B)|0,o=Math.imul(b,z),n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,$)|0)+Math.imul(g,Z)|0,o=o+Math.imul(g,$)|0,n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,H)|0)+Math.imul(v,q)|0,o=o+Math.imul(v,H)|0;var wt=(c+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(l,X)|0))<<13)|0;c=((o=o+Math.imul(l,W)|0)+(i>>>13)|0)+(wt>>>26)|0,wt&=67108863,n=Math.imul(A,B),i=(i=Math.imul(A,z))+Math.imul(E,B)|0,o=Math.imul(E,z),n=n+Math.imul(_,Z)|0,i=(i=i+Math.imul(_,$)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,$)|0,n=n+Math.imul(y,q)|0,i=(i=i+Math.imul(y,H)|0)+Math.imul(g,q)|0,o=o+Math.imul(g,H)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,X)|0,o=o+Math.imul(v,W)|0;var _t=(c+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,tt)|0)+Math.imul(l,Q)|0))<<13)|0;c=((o=o+Math.imul(l,tt)|0)+(i>>>13)|0)+(_t>>>26)|0,_t&=67108863,n=Math.imul(P,B),i=(i=Math.imul(P,z))+Math.imul(T,B)|0,o=Math.imul(T,z),n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,$)|0)+Math.imul(E,Z)|0,o=o+Math.imul(E,$)|0,n=n+Math.imul(_,q)|0,i=(i=i+Math.imul(_,H)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,H)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(g,X)|0,o=o+Math.imul(g,W)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,tt)|0)+Math.imul(v,Q)|0,o=o+Math.imul(v,tt)|0;var bt=(c+(n=n+Math.imul(d,rt)|0)|0)+((8191&(i=(i=i+Math.imul(d,nt)|0)+Math.imul(l,rt)|0))<<13)|0;c=((o=o+Math.imul(l,nt)|0)+(i>>>13)|0)+(bt>>>26)|0,bt&=67108863,n=Math.imul(O,B),i=(i=Math.imul(O,z))+Math.imul(N,B)|0,o=Math.imul(N,z),n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,$)|0)+Math.imul(T,Z)|0,o=o+Math.imul(T,$)|0,n=n+Math.imul(A,q)|0,i=(i=i+Math.imul(A,H)|0)+Math.imul(E,q)|0,o=o+Math.imul(E,H)|0,n=n+Math.imul(_,X)|0,i=(i=i+Math.imul(_,W)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(y,Q)|0,i=(i=i+Math.imul(y,tt)|0)+Math.imul(g,Q)|0,o=o+Math.imul(g,tt)|0,n=n+Math.imul(p,rt)|0,i=(i=i+Math.imul(p,nt)|0)+Math.imul(v,rt)|0,o=o+Math.imul(v,nt)|0;var Mt=(c+(n=n+Math.imul(d,ot)|0)|0)+((8191&(i=(i=i+Math.imul(d,st)|0)+Math.imul(l,ot)|0))<<13)|0;c=((o=o+Math.imul(l,st)|0)+(i>>>13)|0)+(Mt>>>26)|0,Mt&=67108863,n=Math.imul(R,B),i=(i=Math.imul(R,z))+Math.imul(L,B)|0,o=Math.imul(L,z),n=n+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,$)|0)+Math.imul(N,Z)|0,o=o+Math.imul(N,$)|0,n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,H)|0)+Math.imul(T,q)|0,o=o+Math.imul(T,H)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(_,Q)|0,i=(i=i+Math.imul(_,tt)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,tt)|0,n=n+Math.imul(y,rt)|0,i=(i=i+Math.imul(y,nt)|0)+Math.imul(g,rt)|0,o=o+Math.imul(g,nt)|0,n=n+Math.imul(p,ot)|0,i=(i=i+Math.imul(p,st)|0)+Math.imul(v,ot)|0,o=o+Math.imul(v,st)|0;var At=(c+(n=n+Math.imul(d,at)|0)|0)+((8191&(i=(i=i+Math.imul(d,ct)|0)+Math.imul(l,at)|0))<<13)|0;c=((o=o+Math.imul(l,ct)|0)+(i>>>13)|0)+(At>>>26)|0,At&=67108863,n=Math.imul(k,B),i=(i=Math.imul(k,z))+Math.imul(C,B)|0,o=Math.imul(C,z),n=n+Math.imul(R,Z)|0,i=(i=i+Math.imul(R,$)|0)+Math.imul(L,Z)|0,o=o+Math.imul(L,$)|0,n=n+Math.imul(O,q)|0,i=(i=i+Math.imul(O,H)|0)+Math.imul(N,q)|0,o=o+Math.imul(N,H)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(A,Q)|0,i=(i=i+Math.imul(A,tt)|0)+Math.imul(E,Q)|0,o=o+Math.imul(E,tt)|0,n=n+Math.imul(_,rt)|0,i=(i=i+Math.imul(_,nt)|0)+Math.imul(b,rt)|0,o=o+Math.imul(b,nt)|0,n=n+Math.imul(y,ot)|0,i=(i=i+Math.imul(y,st)|0)+Math.imul(g,ot)|0,o=o+Math.imul(g,st)|0,n=n+Math.imul(p,at)|0,i=(i=i+Math.imul(p,ct)|0)+Math.imul(v,at)|0,o=o+Math.imul(v,ct)|0;var Et=(c+(n=n+Math.imul(d,dt)|0)|0)+((8191&(i=(i=i+Math.imul(d,lt)|0)+Math.imul(l,dt)|0))<<13)|0;c=((o=o+Math.imul(l,lt)|0)+(i>>>13)|0)+(Et>>>26)|0,Et&=67108863,n=Math.imul(U,B),i=(i=Math.imul(U,z))+Math.imul(D,B)|0,o=Math.imul(D,z),n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,$)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,$)|0,n=n+Math.imul(R,q)|0,i=(i=i+Math.imul(R,H)|0)+Math.imul(L,q)|0,o=o+Math.imul(L,H)|0,n=n+Math.imul(O,X)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(N,X)|0,o=o+Math.imul(N,W)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,tt)|0)+Math.imul(T,Q)|0,o=o+Math.imul(T,tt)|0,n=n+Math.imul(A,rt)|0,i=(i=i+Math.imul(A,nt)|0)+Math.imul(E,rt)|0,o=o+Math.imul(E,nt)|0,n=n+Math.imul(_,ot)|0,i=(i=i+Math.imul(_,st)|0)+Math.imul(b,ot)|0,o=o+Math.imul(b,st)|0,n=n+Math.imul(y,at)|0,i=(i=i+Math.imul(y,ct)|0)+Math.imul(g,at)|0,o=o+Math.imul(g,ct)|0,n=n+Math.imul(p,dt)|0,i=(i=i+Math.imul(p,lt)|0)+Math.imul(v,dt)|0,o=o+Math.imul(v,lt)|0;var xt=(c+(n=n+Math.imul(d,pt)|0)|0)+((8191&(i=(i=i+Math.imul(d,vt)|0)+Math.imul(l,pt)|0))<<13)|0;c=((o=o+Math.imul(l,vt)|0)+(i>>>13)|0)+(xt>>>26)|0,xt&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,$))+Math.imul(D,Z)|0,o=Math.imul(D,$),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,H)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,H)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(L,X)|0,o=o+Math.imul(L,W)|0,n=n+Math.imul(O,Q)|0,i=(i=i+Math.imul(O,tt)|0)+Math.imul(N,Q)|0,o=o+Math.imul(N,tt)|0,n=n+Math.imul(P,rt)|0,i=(i=i+Math.imul(P,nt)|0)+Math.imul(T,rt)|0,o=o+Math.imul(T,nt)|0,n=n+Math.imul(A,ot)|0,i=(i=i+Math.imul(A,st)|0)+Math.imul(E,ot)|0,o=o+Math.imul(E,st)|0,n=n+Math.imul(_,at)|0,i=(i=i+Math.imul(_,ct)|0)+Math.imul(b,at)|0,o=o+Math.imul(b,ct)|0,n=n+Math.imul(y,dt)|0,i=(i=i+Math.imul(y,lt)|0)+Math.imul(g,dt)|0,o=o+Math.imul(g,lt)|0;var Pt=(c+(n=n+Math.imul(p,pt)|0)|0)+((8191&(i=(i=i+Math.imul(p,vt)|0)+Math.imul(v,pt)|0))<<13)|0;c=((o=o+Math.imul(v,vt)|0)+(i>>>13)|0)+(Pt>>>26)|0,Pt&=67108863,n=Math.imul(U,q),i=(i=Math.imul(U,H))+Math.imul(D,q)|0,o=Math.imul(D,H),n=n+Math.imul(k,X)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(C,X)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(R,Q)|0,i=(i=i+Math.imul(R,tt)|0)+Math.imul(L,Q)|0,o=o+Math.imul(L,tt)|0,n=n+Math.imul(O,rt)|0,i=(i=i+Math.imul(O,nt)|0)+Math.imul(N,rt)|0,o=o+Math.imul(N,nt)|0,n=n+Math.imul(P,ot)|0,i=(i=i+Math.imul(P,st)|0)+Math.imul(T,ot)|0,o=o+Math.imul(T,st)|0,n=n+Math.imul(A,at)|0,i=(i=i+Math.imul(A,ct)|0)+Math.imul(E,at)|0,o=o+Math.imul(E,ct)|0,n=n+Math.imul(_,dt)|0,i=(i=i+Math.imul(_,lt)|0)+Math.imul(b,dt)|0,o=o+Math.imul(b,lt)|0;var Tt=(c+(n=n+Math.imul(y,pt)|0)|0)+((8191&(i=(i=i+Math.imul(y,vt)|0)+Math.imul(g,pt)|0))<<13)|0;c=((o=o+Math.imul(g,vt)|0)+(i>>>13)|0)+(Tt>>>26)|0,Tt&=67108863,n=Math.imul(U,X),i=(i=Math.imul(U,W))+Math.imul(D,X)|0,o=Math.imul(D,W),n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,tt)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,tt)|0,n=n+Math.imul(R,rt)|0,i=(i=i+Math.imul(R,nt)|0)+Math.imul(L,rt)|0,o=o+Math.imul(L,nt)|0,n=n+Math.imul(O,ot)|0,i=(i=i+Math.imul(O,st)|0)+Math.imul(N,ot)|0,o=o+Math.imul(N,st)|0,n=n+Math.imul(P,at)|0,i=(i=i+Math.imul(P,ct)|0)+Math.imul(T,at)|0,o=o+Math.imul(T,ct)|0,n=n+Math.imul(A,dt)|0,i=(i=i+Math.imul(A,lt)|0)+Math.imul(E,dt)|0,o=o+Math.imul(E,lt)|0;var It=(c+(n=n+Math.imul(_,pt)|0)|0)+((8191&(i=(i=i+Math.imul(_,vt)|0)+Math.imul(b,pt)|0))<<13)|0;c=((o=o+Math.imul(b,vt)|0)+(i>>>13)|0)+(It>>>26)|0,It&=67108863,n=Math.imul(U,Q),i=(i=Math.imul(U,tt))+Math.imul(D,Q)|0,o=Math.imul(D,tt),n=n+Math.imul(k,rt)|0,i=(i=i+Math.imul(k,nt)|0)+Math.imul(C,rt)|0,o=o+Math.imul(C,nt)|0,n=n+Math.imul(R,ot)|0,i=(i=i+Math.imul(R,st)|0)+Math.imul(L,ot)|0,o=o+Math.imul(L,st)|0,n=n+Math.imul(O,at)|0,i=(i=i+Math.imul(O,ct)|0)+Math.imul(N,at)|0,o=o+Math.imul(N,ct)|0,n=n+Math.imul(P,dt)|0,i=(i=i+Math.imul(P,lt)|0)+Math.imul(T,dt)|0,o=o+Math.imul(T,lt)|0;var Ot=(c+(n=n+Math.imul(A,pt)|0)|0)+((8191&(i=(i=i+Math.imul(A,vt)|0)+Math.imul(E,pt)|0))<<13)|0;c=((o=o+Math.imul(E,vt)|0)+(i>>>13)|0)+(Ot>>>26)|0,Ot&=67108863,n=Math.imul(U,rt),i=(i=Math.imul(U,nt))+Math.imul(D,rt)|0,o=Math.imul(D,nt),n=n+Math.imul(k,ot)|0,i=(i=i+Math.imul(k,st)|0)+Math.imul(C,ot)|0,o=o+Math.imul(C,st)|0,n=n+Math.imul(R,at)|0,i=(i=i+Math.imul(R,ct)|0)+Math.imul(L,at)|0,o=o+Math.imul(L,ct)|0,n=n+Math.imul(O,dt)|0,i=(i=i+Math.imul(O,lt)|0)+Math.imul(N,dt)|0,o=o+Math.imul(N,lt)|0;var Nt=(c+(n=n+Math.imul(P,pt)|0)|0)+((8191&(i=(i=i+Math.imul(P,vt)|0)+Math.imul(T,pt)|0))<<13)|0;c=((o=o+Math.imul(T,vt)|0)+(i>>>13)|0)+(Nt>>>26)|0,Nt&=67108863,n=Math.imul(U,ot),i=(i=Math.imul(U,st))+Math.imul(D,ot)|0,o=Math.imul(D,st),n=n+Math.imul(k,at)|0,i=(i=i+Math.imul(k,ct)|0)+Math.imul(C,at)|0,o=o+Math.imul(C,ct)|0,n=n+Math.imul(R,dt)|0,i=(i=i+Math.imul(R,lt)|0)+Math.imul(L,dt)|0,o=o+Math.imul(L,lt)|0;var St=(c+(n=n+Math.imul(O,pt)|0)|0)+((8191&(i=(i=i+Math.imul(O,vt)|0)+Math.imul(N,pt)|0))<<13)|0;c=((o=o+Math.imul(N,vt)|0)+(i>>>13)|0)+(St>>>26)|0,St&=67108863,n=Math.imul(U,at),i=(i=Math.imul(U,ct))+Math.imul(D,at)|0,o=Math.imul(D,ct),n=n+Math.imul(k,dt)|0,i=(i=i+Math.imul(k,lt)|0)+Math.imul(C,dt)|0,o=o+Math.imul(C,lt)|0;var Rt=(c+(n=n+Math.imul(R,pt)|0)|0)+((8191&(i=(i=i+Math.imul(R,vt)|0)+Math.imul(L,pt)|0))<<13)|0;c=((o=o+Math.imul(L,vt)|0)+(i>>>13)|0)+(Rt>>>26)|0,Rt&=67108863,n=Math.imul(U,dt),i=(i=Math.imul(U,lt))+Math.imul(D,dt)|0,o=Math.imul(D,lt);var Lt=(c+(n=n+Math.imul(k,pt)|0)|0)+((8191&(i=(i=i+Math.imul(k,vt)|0)+Math.imul(C,pt)|0))<<13)|0;c=((o=o+Math.imul(C,vt)|0)+(i>>>13)|0)+(Lt>>>26)|0,Lt&=67108863;var jt=(c+(n=Math.imul(U,pt))|0)+((8191&(i=(i=Math.imul(U,vt))+Math.imul(D,pt)|0))<<13)|0;return c=((o=Math.imul(D,vt))+(i>>>13)|0)+(jt>>>26)|0,jt&=67108863,a[0]=mt,a[1]=yt,a[2]=gt,a[3]=wt,a[4]=_t,a[5]=bt,a[6]=Mt,a[7]=At,a[8]=Et,a[9]=xt,a[10]=Pt,a[11]=Tt,a[12]=It,a[13]=Ot,a[14]=Nt,a[15]=St,a[16]=Rt,a[17]=Lt,a[18]=jt,0!==c&&(a[19]=c,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=l),o.prototype.mulTo=function(t,e){var r=this.length+t.length;return 10===this.length&&10===t.length?f(this,t,e):r<63?l(this,t,e):r<1024?function(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var n=0,i=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,n=s,s=i}return 0!==n?r.words[o]=n: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,n=0;n>=1;return n},v.prototype.permute=function(t,e,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*e;s>=26,e+=i/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>>i}return e}(t);if(0===e.length)return new o(1);for(var r=this,n=0;n=0);var e,r=t%26,i=(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!==i){for(e=this.length-1;e>=0;e--)this.words[e+i]=this.words[e];for(e=0;e=0),i=e?(e-e%26)/26:0;var o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,c=0;c=0&&(0!==h||c>=i);c--){var d=0|this.words[c];this.words[c]=h<<26-o|d>>>o,h=d&u}return a&&0!==h&&(a.words[a.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(t,e,r){return n(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){n("number"==typeof t&&t>=0);var e=t%26,r=(t-e)/26,i=1<=0);var e=t%26,r=(t-e)/26;if(n(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 i=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(n("number"==typeof t),n(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)-(a/67108864|0),this.words[i+r]=67108863&o}for(;i>26,this.words[i+r]=67108863&o;if(0===u)return this.strip();for(n(-1===u),u=0,i=0;i>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(t,e){var r=(this.length,t.length),n=this.clone(),i=t,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 u,a=n.length-i.length;if("mod"!==e){(u=new o(null)).length=a+1,u.words=new Array(u.length);for(var c=0;c=0;d--){var l=67108864*(0|n.words[i.length+d])+(0|n.words[i.length+d-1]);for(l=Math.min(l/s|0,67108863),n._ishlnsubmul(i,l,d);0!==n.negative;)l--,n.negative=0,n._ishlnsubmul(i,1,d),n.isZero()||(n.negative^=1);u&&(u.words[d]=l)}return u&&u.strip(),n.strip(),"div"!==e&&0!==r&&n.iushrn(r),{div:u||null,mod:n}},o.prototype.divmod=function(t,e,r){return n(!t.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(i=u.div.neg()),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.iadd(t)),{div:i,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(i=u.div.neg()),{div:i,mod:u.mod}):0!=(this.negative&t.negative)?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),r&&0!==s.negative&&s.isub(t)),{div:u.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 i,s,u},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,n=t.ushrn(1),i=t.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},o.prototype.modn=function(t){n(t<=67108863);for(var e=(1<<26)%t,r=0,i=this.length-1;i>=0;i--)r=(e*r+(0|this.words[i]))%t;return r},o.prototype.idivn=function(t){n(t<=67108863);for(var e=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*e;this.words[r]=i/t|0,e=i%t}return this.strip()},o.prototype.divn=function(t){return this.clone().idivn(t)},o.prototype.egcd=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i=new o(1),s=new o(0),u=new o(0),a=new o(1),c=0;e.isEven()&&r.isEven();)e.iushrn(1),r.iushrn(1),++c;for(var h=r.clone(),d=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;)(i.isOdd()||s.isOdd())&&(i.iadd(h),s.isub(d)),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;)(u.isOdd()||a.isOdd())&&(u.iadd(h),a.isub(d)),u.iushrn(1),a.iushrn(1);e.cmp(r)>=0?(e.isub(r),i.isub(u),s.isub(a)):(r.isub(e),u.isub(i),a.isub(s))}return{a:u,b:a,gcd:r.iushln(c)}},o.prototype._invmp=function(t){n(0===t.negative),n(!t.isZero());var e=this,r=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var i,s=new o(1),u=new o(0),a=r.clone();e.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,h=1;0==(e.words[0]&h)&&c<26;++c,h<<=1);if(c>0)for(e.iushrn(c);c-- >0;)s.isOdd()&&s.iadd(a),s.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)u.isOdd()&&u.iadd(a),u.iushrn(1);e.cmp(r)>=0?(e.isub(r),s.isub(u)):(r.isub(e),u.isub(s))}return(i=0===e.cmpn(1)?s:u).cmpn(0)<0&&i.iadd(t),i},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 n=0;e.isEven()&&r.isEven();n++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=e.cmp(r);if(i<0){var o=e;e=r,r=o}else if(0===i||0===r.cmpn(1))break;e.isub(r)}return r.iushln(n)},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){n("number"==typeof t);var e=t%26,r=(t-e)/26,i=1<>>26,u&=67108863,this.words[s]=u}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),n(t<=67108863,"Number is too big");var i=0|this.words[0];e=i===t?0:it.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|t.words[r];if(n!==i){ni&&(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 n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},o.prototype.fromRed=function(){return n(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 n(!this.red,"Already a number in reduction context"),this._forceRed(t)},o.prototype.redAdd=function(t){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},o.prototype.redIAdd=function(t){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},o.prototype.redSub=function(t){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},o.prototype.redISub=function(t){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},o.prototype.redShl=function(t){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},o.prototype.redMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},o.prototype.redIMul=function(t){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},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(t){return n(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 y(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(){y.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){y.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function _(){y.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function b(){y.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 n(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function A(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)}y.prototype._tmp=function(){var t=new o(null);return t.words=new Array(Math.ceil(this.n/13)),t},y.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 n=e0?r.isub(this.p):r.strip(),r},y.prototype.split=function(t,e){t.iushrn(this.n,0,e)},y.prototype.imulK=function(t){return t.imul(this.k)},i(g,y),g.prototype.split=function(t,e){for(var r=Math.min(t.length,9),n=0;n>>22,i=o}i>>>=22,t.words[n-10]=i,0===i&&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]=i,e=n}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 g;else if("p224"===t)e=new w;else if("p192"===t)e=new _;else{if("p25519"!==t)throw new Error("Unknown prime "+t);e=new b}return m[t]=e,e},M.prototype._verify1=function(t){n(0===t.negative,"red works only with positives"),n(t.red,"red works only with red numbers")},M.prototype._verify2=function(t,e){n(0==(t.negative|e.negative),"red works only with positives"),n(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(n(e%2==1),3===e){var r=this.m.add(new o(1)).iushrn(2);return this.pow(t,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var u=new o(1).toRed(this),a=u.redNeg(),c=this.m.subn(1).iushrn(1),h=this.m.bitLength();for(h=new o(2*h*h).toRed(this);0!==this.pow(h,c).cmp(a);)h.redIAdd(a);for(var d=this.pow(h,i),l=this.pow(t,i.addn(1).iushrn(1)),f=this.pow(t,i),p=s;0!==f.cmp(u);){for(var v=f,m=0;0!==v.cmp(u);m++)v=v.redSqr();n(m=0;n--){for(var c=e.words[n],h=a-1;h>=0;h--){var d=c>>h&1;i!==r[0]&&(i=this.sqr(i)),0!==d||0!==s?(s<<=1,s|=d,(4===++u||0===n&&0===h)&&(i=this.mul(i,r[s]),u=0,s=0)):u=0}a=26}return i},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 A(t)},i(A,M),A.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},A.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},A.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),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)},A.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new o(0)._forceRed(this);var r=t.mul(e),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)},A.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(t,this)}).call(this,r(32)(t))},function(t,e,r){"use strict";var n,i=this&&this.__extends||(n=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}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},s=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 u=o(r(9)),a=r(1),c=r(11),h=r(39),d=s(r(3)),l=new u.default.BN(-1);function f(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 p(t){return y(t)._bn}function v(t){return new m(f(t))}var m=function(t){function e(r){var n=t.call(this)||this;if(d.checkNew(n,e),"string"==typeof r)a.isHexString(r)?("0x"==r&&(r="0x0"),c.defineReadOnly(n,"_hex",r)):"-"===r[0]&&a.isHexString(r.substring(1))?c.defineReadOnly(n,"_hex",r):r.match(/^-?[0-9]*$/)?(""==r&&(r="0"),c.defineReadOnly(n,"_hex",f(new u.default.BN(r)))):d.throwError("invalid BigNumber string value",d.INVALID_ARGUMENT,{arg:"value",value:r});else if("number"==typeof r){parseInt(String(r))!==r&&d.throwError("underflow",d.NUMERIC_FAULT,{operation:"setValue",fault:"underflow",value:r,outputValue:parseInt(String(r))});try{c.defineReadOnly(n,"_hex",f(new u.default.BN(r)))}catch(t){d.throwError("overflow",d.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}}else r instanceof e?c.defineReadOnly(n,"_hex",r._hex):r.toHexString?c.defineReadOnly(n,"_hex",f(p(r.toHexString()))):a.isArrayish(r)?c.defineReadOnly(n,"_hex",f(new u.default.BN(a.hexlify(r).substring(2),16))):d.throwError("invalid BigNumber value",d.INVALID_ARGUMENT,{arg:"value",value:r});return n}return i(e,t),Object.defineProperty(e.prototype,"_bn",{get:function(){return"-"===this._hex[0]?new u.default.BN(this._hex.substring(3),16).mul(l):new u.default.BN(this._hex.substring(2),16)},enumerable:!0,configurable:!0}),e.prototype.fromTwos=function(t){return v(this._bn.fromTwos(t))},e.prototype.toTwos=function(t){return v(this._bn.toTwos(t))},e.prototype.add=function(t){return v(this._bn.add(p(t)))},e.prototype.sub=function(t){return v(this._bn.sub(p(t)))},e.prototype.div=function(t){return y(t).isZero()&&d.throwError("division by zero",d.NUMERIC_FAULT,{operation:"divide",fault:"division by zero"}),v(this._bn.div(p(t)))},e.prototype.mul=function(t){return v(this._bn.mul(p(t)))},e.prototype.mod=function(t){return v(this._bn.mod(p(t)))},e.prototype.pow=function(t){return v(this._bn.pow(p(t)))},e.prototype.maskn=function(t){return v(this._bn.maskn(t))},e.prototype.eq=function(t){return this._bn.eq(p(t))},e.prototype.lt=function(t){return this._bn.lt(p(t))},e.prototype.lte=function(t){return this._bn.lte(p(t))},e.prototype.gt=function(t){return this._bn.gt(p(t))},e.prototype.gte=function(t){return this._bn.gte(p(t))},e.prototype.isZero=function(){return this._bn.isZero()},e.prototype.toNumber=function(){try{return this._bn.toNumber()}catch(t){d.throwError("overflow",d.NUMERIC_FAULT,{operation:"setValue",fault:"overflow",details:t.message})}return null},e.prototype.toString=function(){return this._bn.toString(10)},e.prototype.toHexString=function(){return this._hex},e}(h.BigNumber);function y(t){return t instanceof m?t:new m(t)}e.bigNumberify=y,e.ConstantNegativeOne=y(-1),e.ConstantZero=y(0),e.ConstantOne=y(1),e.ConstantTwo=y(2),e.ConstantWeiPerEther=y("1000000000000000000")},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.defineReadOnly=function(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})},e.defineFrozen=function(t,e,r){var n=JSON.stringify(r);Object.defineProperty(t,e,{enumerable:!0,get:function(){return JSON.parse(n)}})},e.resolveProperties=function(t){var e={},r=[];return Object.keys(t).forEach(function(n){var i=t[n];i instanceof Promise?r.push(i.then(function(t){return e[n]=t,null})):e[n]=i}),Promise.all(r).then(function(){return e})},e.shallowCopy=function(t){var e={};for(var r in t)e[r]=t[r];return e},e.jsonCopy=function(t){return JSON.parse(JSON.stringify(t))}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(4);e.normalizeAddress=function(t){return t?n.getAddress(t):null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.parseError=function(t){return t instanceof n.ProviderError?t:new n.ProviderError(n.ProviderIssue.GENERAL,t)}},function(t,e,r){"use strict";var n,i="object"==typeof Reflect?Reflect:null,o=i&&"function"==typeof i.apply?i.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};n=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var s=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}t.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var a=10;function c(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var i,o,s,u;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(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]=n?[r,s]:[s,r]:n?s.unshift(r):s.push(r),(i=c(t))>0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=s.length,u=a,console&&console.warn&&console.warn(u)}return t}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=function(){for(var t=[],e=0;e0&&(s=e[0]),s instanceof Error)throw s;var u=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw u.context=s,u}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)o(a,this,e);else{var c=a.length,h=p(a,c);for(r=0;r=0;o--)if(r[o]===e||r[o].listener===e){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():function(t,e){for(;e+1=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return l(this,t,!0)},u.prototype.rawListeners=function(t){return l(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):f.call(t,e)},u.prototype.listenerCount=f,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.ETH_SIGN=0]="ETH_SIGN",t[t.TREZOR=1]="TREZOR",t[t.EIP712=2]="EIP712",t[t.PERSONAL_SIGN=3]="PERSONAL_SIGN"}(e.SignMethod||(e.SignMethod={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(0),i=r(5),o=r(2),s=r(17),u=r(46);function a(t){return t.kind==o.OrderActionKind.CREATE_ASSET?"00":"01"}function c(t,e){return e.kind==o.OrderActionKind.TRANSFER_VALUE?u.OrderGatewayProxy.TOKEN_TRANSFER:e.kind==o.OrderActionKind.TRANSFER_ASSET?-1===t.provider.unsafeRecipientIds.indexOf(e.ledgerId)?u.OrderGatewayProxy.NFTOKEN_SAFE_TRANSFER:u.OrderGatewayProxy.NFTOKEN_TRANSFER:u.OrderGatewayProxy.XCERT_CREATE}function h(t){return t.kind==o.OrderActionKind.CREATE_ASSET?f(`0x${t.assetImprint}`,64):`${t.senderId}000000000000000000000000`}function d(t){return p(i.bigNumberify(t.assetId||t.value).toHexString(),64,"0",!0)}function l(t){t=t.toString(16).replace(/^0x/i,"");const e=[];for(let r=0;r=0?e-t.length+1:0;return(n?"0x":"")+t+new Array(i).join(r||"0")}function p(t,e,r,n){const i=void 0===n?/^0x/i.test(t)||"number"==typeof t:n,o=e-(t=t.toString(16).replace(/^0x/i,"")).length+1>=0?e-t.length+1:0;return(i?"0x":"")+new Array(o).join(r||"0")+t}e.createOrderHash=function(t,e){let r="0x0000000000000000000000000000000000000000000000000000000000000000";for(const n of e.actions)r=s.keccak256(l(["0x",r.substr(2),a(n),`0000000${c(t,n)}`,n.ledgerId.substr(2),h(n).substr(2),n.receiverId.substr(2),d(n).substr(2)].join("")));return s.keccak256(l(["0x",t.id.substr(2),e.makerId.substr(2),e.takerId.substr(2),r.substr(2),p(s.toInteger(e.seed),64,"0",!1),p(s.toSeconds(e.expiration),64,"0",!1)].join("")))},e.createRecipeTuple=function(t,e){const r=e.actions.map(e=>({kind:a(e),proxy:c(t,e),token:e.ledgerId,param1:h(e),to:e.receiverId,value:d(e)})),n={from:e.makerId,to:e.takerId,actions:r,seed:s.toInteger(e.seed),expirationTimestamp:s.toSeconds(e.expiration)};return s.toTuple(n)},e.createSignatureTuple=function(t){const[e,r]=t.split(":"),i=parseInt(e)==n.SignMethod.PERSONAL_SIGN?n.SignMethod.ETH_SIGN:e,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)},e.getActionKind=a,e.getActionProxy=c,e.getActionParam1=h,e.getActionValue=d,e.hexToBytes=l,e.rightPad=f,e.leftPad=p,e.normalizeOrderIds=function(t,e){return(t=JSON.parse(JSON.stringify(t))).makerId=e.encoder.normalizeAddress(t.makerId),t.takerId=e.encoder.normalizeAddress(t.takerId),t.actions.forEach(t=>{t.ledgerId=e.encoder.normalizeAddress(t.ledgerId),t.receiverId=e.encoder.normalizeAddress(t.receiverId),t.senderId=e.encoder.normalizeAddress(t.senderId)}),t}},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(19)),n(r(21)),n(r(23)),n(r(25)),n(r(26)),n(r(27)),n(r(28)),n(r(29))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=1]="CREATE_ASSET",t[t.TRANSFER_ASSET=2]="TRANSFER_ASSET",t[t.TRANSFER_VALUE=3]="TRANSFER_VALUE"}(e.OrderActionKind||(e.OrderActionKind={}));e.Order=class{}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.fetch=function(t,e){return n(this,void 0,void 0,function*(){return"undefined"!=typeof window?window.fetch(t,e):r(20)(t,e)})}},function(t,e,r){"use strict";var n=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==n)return n;throw new Error("unable to locate global object")}();t.exports=e=n.fetch,e.default=n.fetch.bind(n),e.Headers=n.Headers,e.Request=n.Request,e.Response=n.Response},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.sha=function(t,e){return n(this,void 0,void 0,function*(){if("undefined"!=typeof window){const r=new window.TextEncoder("utf-8").encode(e),n=yield window.crypto.subtle.digest(`SHA-${t}`,r);return Array.from(new Uint8Array(n)).map(t=>`00${t.toString(16)}`.slice(-2)).join("")}return r(22).createHash(`sha${t}`).update(e).digest("hex")})}},function(t,e){t.exports=void 0},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(24);e.keccak256=function(t){return n.keccak256(t)}},function(t,e){const r="0123456789abcdef".split(""),n=[1,256,65536,16777216],i=[0,8,16,24],o=[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],s=t=>{var e,r,n,i,s,u,a,c,h,d,l,f,p,v,m,y,g,w,_,b,M,A,E,x,P,T,I,O,N,S,R,L,j,k,C,G,U,D,F,B,z,V,Z,$,K,q,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ct,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],s=t[1]^t[11]^t[21]^t[31]^t[41],u=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],d=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])^(u<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|u>>>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=i^(c<<1|h>>>31),r=s^(h<<1|c>>>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=u^(d<<1|l>>>31),r=a^(l<<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=c^(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=d^(i<<1|s>>>31),r=l^(s<<1|i>>>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],m=t[1],q=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,k=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ct=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,G=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,j=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,b=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,$=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,T=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,B=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&_,t[10]=x^~T&O,t[11]=P^~I&N,t[20]=k^~G&D,t[21]=C^~U&F,t[30]=$^~q&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&b,t[3]=g^~_&M,t[12]=T^~O&S,t[13]=I^~N&R,t[22]=G^~D&B,t[23]=U^~F&z,t[32]=q^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~b&A,t[5]=_^~M&E,t[14]=O^~S&L,t[15]=N^~R&j,t[24]=D^~B&V,t[25]=F^~z&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ct,t[45]=st^~at&ht,t[6]=b^~A&v,t[7]=M^~E&m,t[16]=S^~L&x,t[17]=R^~j&P,t[26]=B^~V&k,t[27]=z^~Z&C,t[36]=W^~Q&$,t[37]=Y^~tt&K,t[46]=ut^~ct&et,t[47]=at^~ht&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&T,t[19]=j^~P&I,t[28]=V^~k&G,t[29]=Z^~C&U,t[38]=Q^~$&q,t[39]=tt^~K&H,t[48]=ct^~et&nt,t[49]=ht^~rt&it,t[0]^=o[n],t[1]^=o[n+1]},u=t=>e=>{var o;if("0x"===e.slice(0,2)){o=[];for(var u=2,a=e.length;u{for(var o,u=e.length,a=t.blocks,c=t.blockCount<<2,h=t.blockCount,d=t.outputBlocks,l=t.s,f=0;f>2]|=e[f]<>2]|=o<>2]|=(192|o>>6)<>2]|=(128|63&o)<=57344?(a[m>>2]|=(224|o>>12)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<>2]|=(240|o>>18)<>2]|=(128|o>>12&63)<>2]|=(128|o>>6&63)<>2]|=(128|63&o)<=c){for(t.start=m-c,t.block=a[h],m=0;m>2]|=n[3&m],t.lastByteIndex===c)for(a[0]=a[h],m=1;m>4&15]+r[15&p]+r[p>>12&15]+r[p>>8&15]+r[p>>20&15]+r[p>>16&15]+r[p>>28&15]+r[p>>24&15];y%h==0&&(s(l),m=0)}return"0x"+v})((t=>({blocks:[],reset:!0,block:0,start:0,blockCount:1600-(t<<1)>>5,outputBlocks:t>>5,s:(t=>[].concat(t,t,t,t,t))([0,0,0,0,0,0,0,0,0,0])}))(t),o)};t.exports={keccak256:u(256),keccak512:u(512),keccak256s:u(256),keccak512s:u(512)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toFloat=function(t){return parseFloat(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toInteger=function(t){return"number"==typeof t&&t>Number.MAX_SAFE_INTEGER?0:"boolean"==typeof t&&!0===t?1:parseInt(`${t}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toSeconds=function(t){return parseInt(`${parseFloat(`${t}`)/1e3}`)||0}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){return null!=t?t.toString():null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toTuple=function t(e){if(!(e instanceof Object))return[];const r=[];let n=0;return Object.keys(e).forEach(i=>{if(e[i]instanceof Object)r[n]=t(e[i]);else if(e[i]instanceof Array){let o=0;const s=[];e[i].forEach(r=>{s[o]=t(e[i]),o++}),r[n]=s}else r[n]=e[i];n++}),r}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.CREATE_ASSET=2]="CREATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=8]="TOGGLE_TRANSFERS",t[t.UPDATE_ASSET=16]="UPDATE_ASSET",t[t.ALLOW_CREATE_ASSET=32]="ALLOW_CREATE_ASSET",t[t.UPDATE_URI_BASE=64]="UPDATE_URI_BASE"}(e.GeneralAssetLedgerAbility||(e.GeneralAssetLedgerAbility={})),function(t){t[t.MANAGE_ABILITIES=1]="MANAGE_ABILITIES"}(e.SuperAssetLedgerAbility||(e.SuperAssetLedgerAbility={})),function(t){t[t.DESTROY_ASSET=1]="DESTROY_ASSET",t[t.UPDATE_ASSET=2]="UPDATE_ASSET",t[t.REVOKE_ASSET=4]="REVOKE_ASSET",t[t.TOGGLE_TRANSFERS=3]="TOGGLE_TRANSFERS"}(e.AssetLedgerCapability||(e.AssetLedgerCapability={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=new(r(6).AbiCoder);e.encodeParameters=function(t,e){return n.encode(t,e)},e.decodeParameters=function(t,e){return n.decode(t,e)}},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e){},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(35),i=r(1);e.keccak256=function(t){return"0x"+n.keccak_256(i.arrayify(t))}},function(t,e,r){(function(e,r){ +/** + * [js-sha3]{@link https://github.com/emn178/js-sha3} + * + * @version 0.5.7 + * @author Chen, Yi-Cyuan [emn178@gmail.com] + * @copyright Chen, Yi-Cyuan 2015-2016 + * @license MIT + */ +!function(){"use strict";var n="object"==typeof window?window:{};!n.JS_SHA3_NO_NODE_JS&&"object"==typeof e&&e.versions&&e.versions.node&&(n=r);for(var i=!n.JS_SHA3_NO_COMMON_JS&&"object"==typeof t&&t.exports,o="0123456789abcdef".split(""),s=[0,8,16,24],u=[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],c=["hex","buffer","arrayBuffer","array"],h=function(t,e,r){return function(n){return new b(t,e,t).update(n)[r]()}},d=function(t,e,r){return function(n,i){return new b(t,e,i).update(n)[r]()}},l=function(t,e){var r=h(t,e,"hex");r.create=function(){return new b(t,e,t)},r.update=function(t){return r.create().update(t)};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}b.prototype.update=function(t){var e="string"!=typeof t;e&&t.constructor===ArrayBuffer&&(t=new Uint8Array(t));for(var r,n,i=t.length,o=this.blocks,u=this.byteCount,a=this.blockCount,c=0,h=this.s;c>2]|=t[c]<>2]|=n<>2]|=(192|n>>6)<>2]|=(128|63&n)<=57344?(o[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)<=u){for(this.start=r-u,this.block=o[a],r=0;r>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+o[15&t]+o[t>>12&15]+o[t>>8&15]+o[t>>20&15]+o[t>>16&15]+o[t>>28&15]+o[t>>24&15];u%e==0&&(M(r),s=0)}return i&&(t=r[s],i>0&&(a+=o[t>>4&15]+o[15&t]),i>1&&(a+=o[t>>12&15]+o[t>>8&15]),i>2&&(a+=o[t>>20&15]+o[t>>16&15])),a},b.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(u);for(var a=new Uint32Array(t);s>8&255,a[t+2]=e>>16&255,a[t+3]=e>>24&255;u%r==0&&M(n)}return o&&(t=u<<2,e=n[s],o>0&&(a[t]=255&e),o>1&&(a[t+1]=e>>8&255),o>2&&(a[t+2]=e>>16&255)),a};var M=function(t){var e,r,n,i,o,s,a,c,h,d,l,f,p,v,m,y,g,w,_,b,M,A,E,x,P,T,I,O,N,S,R,L,j,k,C,G,U,D,F,B,z,V,Z,$,K,q,H,J,X,W,Y,Q,tt,et,rt,nt,it,ot,st,ut,at,ct,ht;for(n=0;n<48;n+=2)i=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],a=t[3]^t[13]^t[23]^t[33]^t[43],c=t[4]^t[14]^t[24]^t[34]^t[44],h=t[5]^t[15]^t[25]^t[35]^t[45],d=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])^(s<<1|a>>>31),r=(p=t[9]^t[19]^t[29]^t[39]^t[49])^(a<<1|s>>>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=i^(c<<1|h>>>31),r=o^(h<<1|c>>>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=s^(d<<1|l>>>31),r=a^(l<<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=c^(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=d^(i<<1|o>>>31),r=l^(o<<1|i>>>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],m=t[1],q=t[11]<<4|t[10]>>>28,H=t[10]<<4|t[11]>>>28,O=t[20]<<3|t[21]>>>29,N=t[21]<<3|t[20]>>>29,ut=t[31]<<9|t[30]>>>23,at=t[30]<<9|t[31]>>>23,V=t[40]<<18|t[41]>>>14,Z=t[41]<<18|t[40]>>>14,k=t[2]<<1|t[3]>>>31,C=t[3]<<1|t[2]>>>31,y=t[13]<<12|t[12]>>>20,g=t[12]<<12|t[13]>>>20,J=t[22]<<10|t[23]>>>22,X=t[23]<<10|t[22]>>>22,S=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,ct=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,G=t[14]<<6|t[15]>>>26,U=t[15]<<6|t[14]>>>26,w=t[25]<<11|t[24]>>>21,_=t[24]<<11|t[25]>>>21,W=t[34]<<15|t[35]>>>17,Y=t[35]<<15|t[34]>>>17,L=t[45]<<29|t[44]>>>3,j=t[44]<<29|t[45]>>>3,x=t[6]<<28|t[7]>>>4,P=t[7]<<28|t[6]>>>4,nt=t[17]<<23|t[16]>>>9,it=t[16]<<23|t[17]>>>9,D=t[26]<<25|t[27]>>>7,F=t[27]<<25|t[26]>>>7,b=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,$=t[8]<<27|t[9]>>>5,K=t[9]<<27|t[8]>>>5,T=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,B=t[38]<<8|t[39]>>>24,z=t[39]<<8|t[38]>>>24,A=t[48]<<14|t[49]>>>18,E=t[49]<<14|t[48]>>>18,t[0]=v^~y&w,t[1]=m^~g&_,t[10]=x^~T&O,t[11]=P^~I&N,t[20]=k^~G&D,t[21]=C^~U&F,t[30]=$^~q&J,t[31]=K^~H&X,t[40]=et^~nt&ot,t[41]=rt^~it&st,t[2]=y^~w&b,t[3]=g^~_&M,t[12]=T^~O&S,t[13]=I^~N&R,t[22]=G^~D&B,t[23]=U^~F&z,t[32]=q^~J&W,t[33]=H^~X&Y,t[42]=nt^~ot&ut,t[43]=it^~st&at,t[4]=w^~b&A,t[5]=_^~M&E,t[14]=O^~S&L,t[15]=N^~R&j,t[24]=D^~B&V,t[25]=F^~z&Z,t[34]=J^~W&Q,t[35]=X^~Y&tt,t[44]=ot^~ut&ct,t[45]=st^~at&ht,t[6]=b^~A&v,t[7]=M^~E&m,t[16]=S^~L&x,t[17]=R^~j&P,t[26]=B^~V&k,t[27]=z^~Z&C,t[36]=W^~Q&$,t[37]=Y^~tt&K,t[46]=ut^~ct&et,t[47]=at^~ht&rt,t[8]=A^~v&y,t[9]=E^~m&g,t[18]=L^~x&T,t[19]=j^~P&I,t[28]=V^~k&G,t[29]=Z^~C&U,t[38]=Q^~$&q,t[39]=tt^~K&H,t[48]=ct^~et&nt,t[49]=ht^~rt&it,t[0]^=u[n],t[1]^=u[n+1]};if(i)t.exports=p;else for(m=0;m1)for(var r=1;r>=8;return e}function o(t,e,r){for(var n=0,i=0;ie+1+n)throw new Error("invalid rlp")}return{consumed:1+n,result:i}}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+(i=o(t,e+1,r))>t.length)throw new Error("to short");return s(t,e,e+1+r,r+i)}if(t[e]>=192){if(e+1+(i=t[e]-192)>t.length)throw new Error("invalid rlp data");return s(t,e,e+1,i)}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+(i=o(t,e+1,r))>t.length)throw new Error("invalid rlp data");return{consumed:1+r+i,result:n.hexlify(t.slice(e+1+r,e+1+r+i))}}if(t[e]>=128){var i;if(e+1+(i=t[e]-128)>t.length)throw new Error("invlaid rlp data");return{consumed:1+i,result:n.hexlify(t.slice(e+1,e+1+i))}}return{consumed:1,result:n.hexlify(t[e])}}e.encode=function(t){return n.hexlify(function t(e){if(Array.isArray(e)){var r=[];return e.forEach(function(e){r=r.concat(t(e))}),r.length<=55?(r.unshift(192+r.length),r):((o=i(r.length)).unshift(247+o.length),o.concat(r))}var o,s=Array.prototype.slice.call(n.arrayify(e));return 1===s.length&&s[0]<=127?s:s.length<=55?(s.unshift(128+s.length),s):((o=i(s.length)).unshift(183+o.length),o.concat(s))}(t))},e.decode=function(t){var e=n.arrayify(t),r=u(e,0);if(r.consumed!==e.length)throw new Error("invalid rlp data");return r.result}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=function(){return function(){}}();e.BigNumber=n;var i=function(){return function(){}}();e.Indexed=i;var o=function(){return function(){}}();e.MinimalProvider=o;var s=function(){return function(){}}();e.Signer=s;var u=function(){return function(){}}();e.HDNode=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n,i=r(1);!function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"}(n=e.UnicodeNormalizationForm||(e.UnicodeNormalizationForm={})),e.toUtf8Bytes=function(t,e){void 0===e&&(e=n.current),e!=n.current&&(t=t.normalize(e));for(var r=[],o=0,s=0;s>6|192,r[o++]=63&u|128):55296==(64512&u)&&s+1>18|240,r[o++]=u>>12&63|128,r[o++]=u>>6&63|128,r[o++]=63&u|128):(r[o++]=u>>12|224,r[o++]=u>>6&63|128,r[o++]=63&u|128)}return i.arrayify(r)},e.toUtf8String=function(t){t=i.arrayify(t);for(var e="",r=0;r>7!=0){if(n>>6!=2){var o=null;if(n>>5==6)o=1;else if(n>>4==14)o=2;else if(n>>3==30)o=3;else if(n>>2==62)o=4;else{if(n>>1!=126)continue;o=5}if(r+o>t.length){for(;r>6==2;r++);if(r!=t.length)continue;return e}var s,u=n&(1<<8-o-1)-1;for(s=0;s>6!=2)break;u=u<<6|63&a}s==o?u<=65535?e+=String.fromCharCode(u):(u-=65536,e+=String.fromCharCode(55296+(u>>10&1023),56320+(1023&u))):r--}}else e+=String.fromCharCode(n)}return e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(10);e.BigNumber=n.BigNumber,e.bigNumberify=n.bigNumberify},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(6),i=r(4);e.Encoder=class{constructor(){this.coder=new n.AbiCoder}encodeParameters(t,e){return this.coder.encode(t,e)}decodeParameters(t,e){return this.coder.decode(t,e)}normalizeAddress(t){return t?i.getAddress(t):null}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(12),o=r(2),s=r(14);var u;!function(t){t[t.INITIALIZED=0]="INITIALIZED",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED"}(u=e.MutationStatus||(e.MutationStatus={}));e.Mutation=class extends s.EventEmitter{constructor(t,e){super(),this._confirmations=0,this._speed=14e3,this._status=u.INITIALIZED,this._id=e,this._provider=t}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}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 n(this,void 0,void 0,function*(){const t=this._status===u.INITIALIZED;return this.isCompleted()?this:(this.isPending()||(this._status=u.PENDING,this._started=Date.now()),yield new Promise((e,r)=>{this.isCompleted()?e():(this.once(o.MutationEvent.COMPLETE,()=>e()),this.once(o.MutationEvent.ERROR,t=>r(t))),t&&this.loopUntilResolved()}),this)})}forget(){return this._timer&&(clearTimeout(this._timer),this._timer=void 0),this}loopUntilResolved(){return n(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=i.normalizeAddress(t.from),this._receiverId=i.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 this._status=u.COMPLETED,this.emit(o.MutationEvent.COMPLETE,this);this.emit(o.MutationEvent.CONFIRM,this)}-1===this._provider.mutationTimeout||Date.now()-this._startedthis.encoder.normalizeAddress(t))}get orderGatewayId(){return this._orderGatewayId||null}set orderGatewayId(t){this._orderGatewayId=this.encoder.normalizeAddress(t)}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}getAvailableAccounts(){return n(this,void 0,void 0,function*(){return(yield this.post({method:"eth_accounts",params:[]})).result.map(t=>this.encoder.normalizeAddress(t))})}getNetworkVersion(){return n(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 n(this,void 0,void 0,function*(){const e=Object.assign({},t);if("eth_sendTransaction"===e.method&&e.params.length){if(void 0===e.params[0].gas){const t=yield this.request(Object.assign({},e,{method:"eth_estimateGas"}));e.params[0].gas=`0x${Math.ceil(1.1*t.result).toString(16)}`}if(void 0===e.params[0].gasPrice){const t=yield this.request(Object.assign({},e,{method:"eth_gasPrice",params:[]}));e.params[0].gasPrice=`0x${Math.ceil(1.1*t.result).toString(16)}`}}return this.request(e)})}request(t){return n(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,(n,i)=>n?r(n):i.error?r(i.error):i.id!==e.id?r("Invalid RPC id"):t(i))}).catch(t=>{throw u.parseError(t)})})}getNextId(){return this._id++,this._id}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});const n=r(2);e.getInterfaceCode=function(t){return t==n.AssetLedgerCapability.DESTROY_ASSET?"0x9d118770":t==n.AssetLedgerCapability.REVOKE_ASSET?"0x20c5429b":t==n.AssetLedgerCapability.UPDATE_ASSET?"0xbda0e852":t==n.AssetLedgerCapability.TOGGLE_TRANSFERS?"0xbedb86fb":null}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.XCERT_CREATE=0]="XCERT_CREATE",t[t.TOKEN_TRANSFER=1]="TOKEN_TRANSFER",t[t.NFTOKEN_TRANSFER=2]="NFTOKEN_TRANSFER",t[t.NFTOKEN_SAFE_TRANSFER=3]="NFTOKEN_SAFE_TRANSFER"}(e.OrderGatewayProxy||(e.OrderGatewayProxy={}))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(2);e.GeneralAssetLedgerAbility=n.GeneralAssetLedgerAbility,e.SuperAssetLedgerAbility=n.SuperAssetLedgerAbility,e.AssetLedgerCapability=n.AssetLedgerCapability,function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(49))},function(t,e,r){"use strict";function n(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}Object.defineProperty(e,"__esModule",{value:!0}),n(r(18)),n(r(75)),n(r(46))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(50),u=r(51),a=r(52),c=r(53),h=r(54),d=r(55),l=r(56),f=r(57),p=r(58),v=r(59),m=r(60),y=r(61),g=r(62),w=r(63),_=r(64),b=r(65),M=r(67),A=r(68),E=r(69),x=r(70),P=r(71),T=r(72),I=r(73),O=r(74);e.AssetLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return a.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getAbilities(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),w.default(this,t)})}getApprovedAccount(t){return n(this,void 0,void 0,function*(){return b.default(this,t)})}getAssetAccount(t){return n(this,void 0,void 0,function*(){return A.default(this,t)})}getAsset(t){return n(this,void 0,void 0,function*(){return M.default(this,t)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),x.default(this,t)})}getCapabilities(){return n(this,void 0,void 0,function*(){return P.default(this)})}getInfo(){return n(this,void 0,void 0,function*(){return T.default(this)})}getAssetIdAt(t){return n(this,void 0,void 0,function*(){return E.default(this,t)})}getAccountAssetIdAt(t,e){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),_.default(this,t,e)})}isApprovedAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),(e=this._provider.encoder.normalizeAddress(e))===(yield b.default(this,t))})}isTransferable(){return n(this,void 0,void 0,function*(){return O.default(this)})}approveAccount(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),e=this._provider.encoder.normalizeAddress(e),s.default(this,e,t)})}disapproveAccount(t){return n(this,void 0,void 0,function*(){return s.default(this,"0x0000000000000000000000000000000000000000",t)})}grantAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0)),t=this._provider.encoder.normalizeAddress(t);let r=i.bigNumberify(0);return e.forEach(t=>{r=r.add(t)}),h.default(this,t,r)})}createAsset(t){return n(this,void 0,void 0,function*(){const e=t.imprint||"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",r=this._provider.encoder.normalizeAddress(t.receiverId);return u.default(this,r,t.id,`0x${e}`)})}destroyAsset(t){return n(this,void 0,void 0,function*(){return c.default(this,t)})}revokeAbilities(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof t&&(t=yield t.getProxyAccountId(0));let r=!1;-1!==e.indexOf(o.SuperAssetLedgerAbility.MANAGE_ABILITIES)&&(r=!0),t=this._provider.encoder.normalizeAddress(t);let n=i.bigNumberify(0);return e.forEach(t=>{n=n.add(t)}),d.default(this,t,n,r)})}revokeAsset(t){return n(this,void 0,void 0,function*(){return l.default(this,t)})}transferAsset(t){return n(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 n(this,void 0,void 0,function*(){return v.default(this,!0)})}disableTransfers(){return n(this,void 0,void 0,function*(){return v.default(this,!1)})}updateAsset(t,e){return n(this,void 0,void 0,function*(){return g.default(this,t,e.imprint)})}update(t){return n(this,void 0,void 0,function*(){return y.default(this,t.uriBase)})}approveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!0)})}disapproveOperator(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),p.default(this,t,!1)})}isApprovedOperator(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(this.getProxyId())),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),I.default(this,t,e)})}getProxyId(){return-1===this.provider.unsafeRecipientIds.indexOf(this.id)?3:2}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xb0e329e4",s=["address","uint256","bytes32"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=r(45),u=["string","string","string","bytes32","bytes4[]"];e.default=function(t,{name:e,symbol:r,uriBase:a,schemaId:c,capabilities:h}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.assetLedgerSource).then(t=>t.json())).XcertMock.evm.bytecode.object,d=(h||[]).map(t=>s.getInterfaceCode(t)),l={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(u,[e,r,a,c,d]).substr(2)}`},f=yield t.post({method:"eth_sendTransaction",params:[l]});return new i.Mutation(t,f.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x9d118770",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x0ab319e8",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xaca910e7",s=["address","uint256","bool"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x20c5429b",s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0);e.default=function(t,e,r,o,s){return n(this,void 0,void 0,function*(){const n=void 0!==s?"0xb88d4fde":"0x42842e0e",u=["address","address","uint256"];void 0!==s&&u.push("bytes");const a=[e,r,o,s].filter(t=>void 0!==t),c={from:t.provider.accountId,to:t.id,data:n+t.provider.encoder.encodeParameters(u,a).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa22cb465",s=["address","bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbedb86fb",s=["bool"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[!e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x27fc0cff",s=["string"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_sendTransaction",params:[r]});return new i.Mutation(t.provider,n.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xbda0e852",s=["uint256","bytes32"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o="0xba00a330",s=["address","uint256"],u=["bool"];e.default=function(t,e){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].map(r=>n(this,void 0,void 0,function*(){const n={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]?r:-1}))).then(t=>t.filter(t=>-1!==t).sort((t,e)=>t-e)).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x2f745c59",o=["address","uint256"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(66),o="0x081812fc",s=["uint256"],u=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(r){return i.default(t,e)}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x481af3d3",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0xc87b56dd",inputTypes:["uint256"],outputTypes:["string"]},{signature:"0x70c31afc",inputTypes:["uint256"],outputTypes:["bytes32"]}];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=yield Promise.all(i.map(r=>n(this,void 0,void 0,function*(){try{const n={to:t.id,data:r.signature+t.provider.encoder.encodeParameters(r.inputTypes,[e]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(r.outputTypes,i.result)[0]}catch(t){return null}})));return{id:e,uri:r[0],imprint:r[1]?r[1].substr(2):r[1]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x6352211e",o=["uint256"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x4f6ccce7",o=["uint256"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(2),o=r(45),s="0x01ffc9a7",u=["bytes8"],a=["bool"];e.default=function(t){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(e=>n(this,void 0,void 0,function*(){const r=o.getInterfaceCode(e),n={to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(a,i.result)[0]?e:-1}))).then(t=>t.filter(t=>-1!==t).sort()).catch(()=>[])})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=[{signature:"0x06fdde03",inputTypes:[],outputTypes:["string"]},{signature:"0x95d89b41",inputTypes:[],outputTypes:["string"]},{signature:"0xfbca0ce1",inputTypes:[],outputTypes:["string"]},{signature:"0x075b1a09",inputTypes:[],outputTypes:["bytes32"]},{signature:"0x18160ddd",inputTypes:[],outputTypes:["uint256"]}];e.default=function(t){return n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],uriBase:e[2],schemaId:e[3],supply:e[4]}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xe985e9c5",o=["address","address"],s=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xb187bd26",o=[],s=["bool"];e.default=function(t){return n(this,void 0,void 0,function*(){try{const e={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[]).substr(2)},r=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return!t.provider.encoder.decodeParameters(s,r.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s=r(76),u=r(77),a=r(78),c=r(79),h=r(80),d=r(81),l=r(82);e.OrderGateway=class{static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e||t.orderGatewayId)}get id(){return this._id}get provider(){return this._provider}claim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),this._provider.signMethod==i.SignMethod.PERSONAL_SIGN?c.default(this,t):a.default(this,t)})}perform(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),u.default(this,t,e)})}cancel(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),s.default(this,t)})}getProxyAccountId(t){return n(this,void 0,void 0,function*(){return d.default(this,t)})}isValidSignature(t,e){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),l.default(this,t,e)})}getOrderDataClaim(t){return n(this,void 0,void 0,function*(){return t=o.normalizeOrderIds(t,this._provider),h.default(this,t)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x36d63aca",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=o.createRecipeTuple(t,e),n={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[r]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(16),s="0x8b1d8335",u=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)","tuple(bytes32, bytes32, uint8, uint8)"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=o.createRecipeTuple(t,e),a=o.createSignatureTuple(r),c={from:t.provider.accountId,to:t.id,data:s+t.provider.encoder.encodeParameters(u,[n,a]).substr(2)},h=yield t.provider.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t.provider,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"eth_sign",params:[t.provider.accountId,r]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16);e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createOrderHash(t,e),n=yield t.provider.post({method:"personal_sign",params:[r,t.provider.accountId,null]});return`${t.provider.signMethod}:${n.result}`})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0xd1c87f30",s=["tuple(address, address, tuple[](uint8, uint32, address, bytes32, address, uint256), uint256, uint256)"],u=["bytes32"];e.default=function(t,e){return n(this,void 0,void 0,function*(){const r=i.createRecipeTuple(t,e);try{const e={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[r]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[e,"latest"]});return t.provider.encoder.decodeParameters(u,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xabd90f85",o=["uint8"],s=["address"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(16),o="0x8fa76d8d",s=["address","bytes32","tuple(bytes32, bytes32, uint8, uint8)"],u=["bool"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n=i.createOrderHash(t,e),a=i.createSignatureTuple(r);try{const r={to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e.makerId,n,a]).substr(2)},i=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(u,i.result)[0]}catch(t){return null}})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(84))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(5),o=r(2),s=r(85),u=r(86),a=r(87),c=r(88),h=r(89),d=r(90),l=r(91);e.ValueLedger=class{static deploy(t,e){return n(this,void 0,void 0,function*(){return u.default(t,e)})}static getInstance(t,e){return new this(t,e)}constructor(t,e){this._provider=t,this._id=this._provider.encoder.normalizeAddress(e)}get id(){return this._id}get provider(){return this._provider}getApprovedValue(t,e){return n(this,void 0,void 0,function*(){return"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),e=this._provider.encoder.normalizeAddress(e),h.default(this,t,e)})}getBalance(t){return n(this,void 0,void 0,function*(){return t=this._provider.encoder.normalizeAddress(t),d.default(this,t)})}getInfo(){return n(this,void 0,void 0,function*(){return l.default(this)})}isApprovedValue(t,e,r){return n(this,void 0,void 0,function*(){"string"!=typeof r&&(r=yield r.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e),r=this._provider.encoder.normalizeAddress(r);const n=yield h.default(this,e,r);return i.bigNumberify(n).gte(i.bigNumberify(t))})}approveValue(t,e){return n(this,void 0,void 0,function*(){"string"!=typeof e&&(e=yield e.getProxyAccountId(1)),e=this._provider.encoder.normalizeAddress(e);const r=yield this.getApprovedValue(this.provider.accountId,e);if(!i.bigNumberify(t).isZero()&&!i.bigNumberify(r).isZero())throw new o.ProviderError(o.ProviderIssue.GENERAL,"First set approval to 0. ERC20 token potential attack.");return s.default(this,e,t)})}disapproveValue(t){return n(this,void 0,void 0,function*(){return"string"!=typeof t&&(t=yield t.getProxyAccountId(1)),t=this._provider.encoder.normalizeAddress(t),s.default(this,t,"0")})}transferValue(t){return n(this,void 0,void 0,function*(){const e=this._provider.encoder.normalizeAddress(t.senderId),r=this._provider.encoder.normalizeAddress(t.receiverId);return t.senderId?c.default(this,e,r,t.value):a.default(this,r,t.value)})}}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x095ea7b3",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o=r(17),s=["string","string","uint8","uint256"];e.default=function(t,{name:e,symbol:r,decimals:u,supply:a}){return n(this,void 0,void 0,function*(){const n=(yield o.fetch(t.valueLedgerSource).then(t=>t.json())).TokenMock.evm.bytecode.object,c={from:t.accountId,data:`0x${n}${t.encoder.encodeParameters(s,[e,r,u,a]).substr(2)}`},h=yield t.post({method:"eth_sendTransaction",params:[c]});return new i.Mutation(t,h.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0xa9059cbb",s=["address","uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,u.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(0),o="0x23b872dd",s=["address","address","uint256"];e.default=function(t,e,r,u){return n(this,void 0,void 0,function*(){const n={from:t.provider.accountId,to:t.id,data:o+t.provider.encoder.encodeParameters(s,[e,r,u]).substr(2)},a=yield t.provider.post({method:"eth_sendTransaction",params:[n]});return new i.Mutation(t.provider,a.result)})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0xdd62ed3e",o=["address","address"],s=["uint256"];e.default=function(t,e,r){return n(this,void 0,void 0,function*(){try{const n={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e,r]).substr(2)},u=yield t.provider.post({method:"eth_call",params:[n,"latest"]});return t.provider.encoder.decodeParameters(s,u.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i="0x70a08231",o=["address"],s=["uint256"];e.default=function(t,e){return n(this,void 0,void 0,function*(){try{const r={to:t.id,data:i+t.provider.encoder.encodeParameters(o,[e]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(s,n.result)[0].toString()}catch(t){return null}})}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.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 n(this,void 0,void 0,function*(){const e=yield Promise.all(i.map(e=>n(this,void 0,void 0,function*(){try{const r={to:t.id,data:e.signature+t.provider.encoder.encodeParameters(e.inputTypes,[]).substr(2)},n=yield t.provider.post({method:"eth_call",params:[r,"latest"]});return t.provider.encoder.decodeParameters(e.outputTypes,n.result)[0].toString()}catch(t){return null}})));return{name:e[0],symbol:e[1],decimals:e[2],supply:e[3]}})}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(93))},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0});const i=r(94),o=r(17),s=r(96);class u{static getInstance(t){return new u(t)}constructor(t){this.schema=t.schema,this.merkle=new i.Merkle(Object.assign({hasher:t=>n(this,void 0,void 0,function*(){return o.sha(256,s.toString(t))}),noncer:t=>n(this,void 0,void 0,function*(){return o.sha(256,t.join("."))})},t))}notarize(t){return n(this,void 0,void 0,function*(){const e=this.buildSchemaProps(t),r=yield this.buildCompoundProps(e);return(yield this.buildRecipes(r)).map(t=>({path:t.path,nodes:t.nodes,values:t.values}))})}expose(t,e){const r={};return e.forEach(e=>{const n=s.readPath(e,t);s.writePath(e,n,r)}),JSON.parse(JSON.stringify(r))}disclose(t,e){return n(this,void 0,void 0,function*(){const r=this.buildSchemaProps(t),n=yield this.buildCompoundProps(r);return(yield this.buildRecipes(n,e)).map(t=>({path:t.path,nodes:t.nodes,values:t.values}))})}calculate(t,e){return n(this,void 0,void 0,function*(){try{return this.checkDataInclusion(t,e)?this.imprintRecipes(e):null}catch(t){return null}})}imprint(t){return n(this,void 0,void 0,function*(){return this.notarize(t).then(t=>t[0].nodes[0].hash)})}buildSchemaProps(t,e=this.schema,r=[]){return"array"===e.type?(t||[]).map((t,n)=>this.buildSchemaProps(t,e.items,[...r,n])).reduce((t,e)=>t.concat(e),[]):"object"===e.type?Object.keys(e.properties).sort().map(n=>{const i=this.buildSchemaProps((t||{})[n],e.properties[n],[...r,n]);return-1===["object","array"].indexOf(e.properties[n].type)?[i]:i}).reduce((t,e)=>t.concat(e),[]):{path:r,value:t,key:r.join("."),group:r.slice(0,-1).join(".")}}buildCompoundProps(t){return n(this,void 0,void 0,function*(){t=[...t];const e=this.buildPropGroups(t),r=Object.keys(e).sort((t,e)=>t>e?-1:1).filter(t=>""!==t);for(const n of r){const r=e[n],i=[...t.filter(t=>t.group===n)].sort((t,e)=>t.key>e.key?1:-1).map(t=>t.value),o=yield this.merkle.notarize(i,r);t.push({path:r,value:o.nodes[0].hash,key:r.join("."),group:r.slice(0,-1).join(".")})}return t.sort((t,e)=>t.key>e.key?1:-1)})}buildRecipes(t,e=null){return n(this,void 0,void 0,function*(){const r=e?s.stepPaths(e).map(t=>t.join(".")):null,i={};return t.forEach(t=>i[t.group]=t.path.slice(0,-1)),Promise.all(Object.keys(i).map(e=>n(this,void 0,void 0,function*(){const n=t.filter(t=>t.group===e).map(t=>t.value);let o=yield this.merkle.notarize(n,i[e]);if(r){const n=t.filter(t=>t.group===e).map((t,e)=>-1===r.indexOf(t.key)?-1:e).filter(t=>-1!==t);o=yield this.merkle.disclose(o,n)}if(!r||-1!==r.indexOf(i[e].join(".")))return{path:i[e],values:o.values,nodes:o.nodes,key:i[e].join("."),group:i[e].slice(0,-1).join(".")}}))).then(t=>t.filter(t=>!!t))})}checkDataInclusion(t,e){const r=this.buildSchemaProps(t);e=s.cloneObject(e).map(t=>Object.assign({key:t.path.join("."),group:t.path.slice(0,-1).join(".")},t));for(const n of r){const r=s.readPath(n.path,t);if(void 0===r)continue;const i=n.path.slice(0,-1).join("."),o=e.find(t=>t.key===i);if(!o)return!1;const u=this.getPathIndexes(n.path).pop();if(o.values.find(t=>t.index===u).value!==r)return!1}return!0}imprintRecipes(t){return n(this,void 0,void 0,function*(){if(0===t.length)return this.getEmptyImprint();t=s.cloneObject(t).map(t=>Object.assign({key:t.path.join("."),group:t.path.slice(0,-1).join(".")},t)).sort((t,e)=>t.path.length>e.path.length?-1:1);for(const e of t){const r=yield this.merkle.imprint(e).catch(()=>"");e.nodes.unshift({index:0,hash:r});const n=e.path.slice(0,-1).join("."),i=e.path.slice(0,-1),o=this.getPathIndexes(e.path).slice(-1).pop(),s=t.find(t=>t.key===n);s&&s.values.unshift({index:o,value:r,nonce:yield this.merkle.nonce([...i,o])})}const e=t.find(t=>""===t.key);return e?e.nodes.find(t=>0===t.index).hash:this.getEmptyImprint()})}getPathIndexes(t){const e=[];let r=this.schema;for(const n of t)"array"===r.type?(e.push(n),r=r.items):"object"===r.type?(e.push(Object.keys(r.properties).sort().indexOf(n)),r=r.properties[n]):e.push(void 0);return e}getEmptyImprint(){return n(this,void 0,void 0,function*(){return this.merkle.notarize([]).then(t=>t.nodes[0].hash)})}buildPropGroups(t){const e={};return t.map(t=>{const e=[];return t.path.map(t=>(e.push(t),[...e]))}).reduce((t,e)=>t.concat(e),[]).forEach(t=>e[t.slice(0,-1).join(".")]=t.slice(0,-1)),e}}e.Cert=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r])}(r(95))},function(t,e,r){"use strict";var n,i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))(function(i,o){function s(t){try{a(n.next(t))}catch(t){o(t)}}function u(t){try{a(n.throw(t))}catch(t){o(t)}}function a(t){t.done?i(t.value):new r(function(e){e(t.value)}).then(s,u)}a((n=n.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),function(t){t[t.VALUE=0]="VALUE",t[t.LEAF=1]="LEAF",t[t.NODE=2]="NODE"}(n=e.MerkleHasherPosition||(e.MerkleHasherPosition={}));e.Merkle=class{constructor(t){this._options=Object.assign({hasher:t=>t,noncer:()=>""},t)}hash(t,e,r){return this._options.hasher(t,e,r)}nonce(t){return this._options.noncer(t)}notarize(t,e=[]){return i(this,void 0,void 0,function*(){const r=[...t],i=[],o=yield this._options.noncer([...e,r.length]),s=[yield this._options.hasher(o,[...e,r.length],n.NODE)];for(let t=r.length-1;t>=0;t--){const o=s[0];i.unshift(yield this._options.noncer([...e,t]));const u=yield this._options.hasher(r[t],[...e,t],n.VALUE);s.unshift(yield this._options.hasher(`${u}${i[0]}`,[...e,t],n.LEAF));const a=s[0];s.unshift(yield this._options.hasher(`${a}${o}`,[...e,t],n.NODE))}return{values:r.map((t,e)=>({index:e,value:t,nonce:i[e]})),nodes:s.map((t,e)=>({index:e,hash:t}))}})}disclose(t,e){return i(this,void 0,void 0,function*(){const r=Math.max(...e.map(t=>t+1),0),n=[],i=[t.nodes.find(t=>t.index===2*r)];for(let o=r-1;o>=0;o--)-1!==e.indexOf(o)?n.unshift(t.values.find(t=>t.index===o)):i.unshift(t.nodes.find(t=>t.index===2*o+1));return{values:n,nodes:i}})}imprint(t){return i(this,void 0,void 0,function*(){const e=[...yield Promise.all(t.values.map((t,e)=>i(this,void 0,void 0,function*(){const r=yield this._options.hasher(t.value,[e],n.VALUE);return{index:2*t.index+1,hash:yield this._options.hasher(`${r}${t.nonce}`,[e],n.LEAF),value:t.value}}))),...t.nodes];for(let t=Math.max(...e.map(t=>t.index+1),0)-1;t>=0;t-=2){const r=e.find(e=>e.index===t),i=e.find(e=>e.index===t-1);r&&i&&e.unshift({index:t-2,hash:yield this._options.hasher(`${i.hash}${r.hash}`,[t],n.NODE)})}const r=e.find(t=>0===t.index);return r?r.hash:null})}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.toString=function(t){try{return null==t?"":`${t}`}catch(t){return""}},e.cloneObject=function(t){return JSON.parse(JSON.stringify(t))},e.stepPaths=function(t){const e={"":[]};return t.forEach(t=>{const r=[];t.forEach(t=>{r.push(t),e[r.join(".")]=[...r]})}),Object.keys(e).sort().map(t=>e[t])},e.readPath=function t(e,r){try{return Array.isArray(e)?0===e.length?r:t(e.slice(1),r[e[0]]):void 0}catch(t){return}},e.writePath=function(t,e,r={}){let n=r=r||{};for(let r=0;r { + console.log('Account has changed', accountId); +}); +``` + +**See also:** + +[once (event, handler)](#once-event-handler), [off (event, handler)](#off-event-handler) + +### once(event, handler); + +A `synchronous` class instance `function` which attaches a new event handler. The event is automatically removed once the first `event` is emitted. + +**Arguments:** + +| Argument | Description +|-|- +| event | [required] A `string` representing a [provider event](#provider-events) name. +| handler | [required] A callback `function` which is triggered on each `event`. When the `event` equals `ACCOUNT_CHANGE`, the first argument is a new account ID and the second is the old one. + +**Result:** + +An instance of the same provider class. + +**Example:** + +```ts +import { ProviderEvent } from '@0xcert/wanchain-http-provider'; + +provider.on(ProviderEvent.ACCOUNT_CHANGE, (accountId) => { + console.log('Account has changed', accountId); +}); +``` + +**See also:** + +[on (event, handler)](#on-event-handler), [off (event, handler)](#off-event-handler) + +### off(event, handler) + +A `synchronous` class instance `function` which removes an existing event handler. + +**Arguments:** + +| Argument | Description +|-|- +| event | [required] A `string` representing a [provider event](#provider-events) name. +| handler | A specific callback `function` of an event. If not provided, all handlers of the `event` are removed. + +**Result:** + +An instance of the same provider class. + +**Example:** + +```ts +import { ProviderEvent } from '@0xcert/wanchain-http-provider'; + +provider.off(ProviderEvent.NETWORK_CHANGE); +``` + +**See also:** + +[on (event, handler)](#on-event-handler), [once (event, handler)](#once-event-handler) + +### orderGatewayId + +A class instance `variable` holding a `string` which represents a Wanchain address of the [order gateway](/#public-addresses). + +### requiredConfirmations + +A class instance `variable` holding a `string` which represents the number of confirmations needed for mutations to be considered confirmed. It defaults to `1`. + +### signMethod + +A class instance `variable` holding a `string` which holds a type of signature that will be used (e.g. when creating claims). + +### unsafeRecipientIds + +A class instance `variable` holding a `string` which represents smart contract addresses that do not support safe ERC-721 transfers. + +### valueLedgerSource + +A class instance `variable` holding a `string` which represents the URL to the compiled ERC-20 related smart contract definition file. This file is used when deploying new value ledgers to the network. + +## Provider events + +We can listen to different provider events. Note that not all the providers are able to emit all the events listed here. + +**Options:** + +| Name | Value | Description +|-|-|- +| ACCOUNT_CHANGE | accountChange | Triggered when an `accountId` is changed. +| NETWORK_CHANGE | networkChange | Triggered when network version is changed. + +**Example:** + +```ts +provider.on(ProviderEvent.ACCOUNT_CHANGE, (accountId) => { + console.log('Account has changed', accountId); +}); +provider.on(ProviderEvent.NETWORK_CHANGE, (networkVersion) => { + console.log('Network has changed', networkVersion); +}); +``` + +## Mutation + +The 0xcert Framework performs mutations for any request that changes the state on the Wanchain blockchain. + +### Mutation(provider, mutationId) + +A `class` which handles transaction-related operations on the Wanchain blockchain. + +**Arguments** + +| Argument | Description +|-|-|- +| mutationId | [required] A `string` representing a hash string of a Wanchain transaction. +| provider | [required] An instance of an HTTP provider. + +**Usage** + +```ts +import { Mutation } from '@0xcert/wanchain-http-provider'; + +// arbitrary data +const mutationId = '0x...'; + +// create mutation instance +const mutation = new Mutation(provider, mutationId); +``` + +### complete() + +An `asynchronous` class instance `function` which waits until the mutation reaches the specified number of confirmations. + +::: tip +Number of required confirmations is configurable through the provider instance. +::: + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// wait until confirmed +await mutation.complete(); +``` + +**See also:** + +[forget()](#forget) + +### confirmations + +A class instance `variable` holding an `integer` number of confirmations reached. Default is `0`. + +### emit(event, options); + +A `synchronous` class instance `function` to manually trigger a mutation event. + +**Arguments:** + +| Argument | Description +|-|- +| event | [required] A `string` representing a [mutation event](#mutation-events) name. +| options | For `ERROR` event, an instance of an `Error` must be provided. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { MutationEvent } from '@0xcert/wanchain-http-provider'; + +mutation.emit(MutationEvent.ERROR, new Error('Unhandled error')); +``` + +### forget() + +A `synchronous` class instance `function` which stops listening for confirmations which causes the `complete()` function to resolve immediately. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +mutation.forget(); +``` + +### id + +A class instance `variable` holding a `string` which represents a hash of a Wanchain transaction. + +### isCompleted() + +A `synchronous` class instance `function` which returns `true` if a mutation has reached the required number of confirmations. + +**Result:** + +A `boolean` telling if the mutation has been completed. + +**Example:** + +```ts +mutation.isCompleted(); +``` + +**See also:** + +[isPending](#is-pending) + +### isPending() + +A `synchronous` class instance `function` which returns `true` when a mutation is in the process of completion. + +**Result:** + +A `boolean` telling if the mutation is waiting to be confirmed. + +**Example:** + +```ts +mutation.isPending(); +``` + +**See also:** + +[isPending](#is-pending) + +### on(event, handler); + +A `synchronous` class instance `function` which attaches a new event handler. + +**Arguments:** + +| Argument | Description +|-|- +| event | [required] A `string` representing a [mutation event](#mutation-events) name. +| handler | [required] A callback `function` which is triggered on each `event`. When the `event` equals `ERROR`, the first argument is an `Error`, otherwise the current `Mutation` instance is received. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { MutationEvent } from '@0xcert/wanchain-http-provider'; + +mutation.on(MutationEvent.COMPLETE, () => { + console.log('Mutation has been completed!'); +}); +``` + +**See also:** + +[once(event, handler)](#once-event-handler), [off (event, handler)](#off-event-handler) + +### once(event, handler); + +A `synchronous` class instance `function` which attaches a new event handler. The event is automatically removed once the first `event` is emitted. + +**Arguments:** + +| Argument | Description +|-|- +| event | [required] A `string` representing a [mutation event](#mutation-events) name. +| handler | A callback `function` which is triggered on each `event`. When the `event` equals `ERROR`, the first argument is an `Error`, otherwise the current `Mutation` instance is received. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { MutationEvent } from '@0xcert/wanchain-http-provider'; + +mutation.once(MutationEvent.COMPLETE, () => { + console.log('Mutation has been completed!'); +}); +``` + +**See also:** + +[on (event, handler)](#on-event-handler), [off (event, handler)](#off-event-handler) + +### off(event, handler) + +A `synchronous` class instance `function` which removes an existing event. + +**Arguments:** + +| Argument | Description +|-|- +| event | [required] A `string` representing a [mutation event](#mutation-events) name. +| handler | A specific callback `function` of an event. If not provided, all handlers of the `event` are removed. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { MutationEvent } from '@0xcert/wanchain-http-provider'; + +mutation.off(MutationEvent.ERROR); +``` + +**See also:** + +[on (event, handler)](#on-event-handler), [once (event, handler)](#once-event-handler) + +### receiverId + +A class instance `variable` holding a `string` which represents a Wanchain account address that plays the role of a receiver. + +::: tip +When you are deploying a new ledger, this variable represents the ledger ID and is `null` until a mutation is completed. +::: + +### senderId + +A class instance `variable` holding a `string` which represents a Wanchain account address that plays the role of a sender. + +## Mutation events + +We can listen to different mutation events which are emitted by the mutation in the process of completion. + +**Options:** + +| Name | Value | Description +|-|-|- +| COMPLETE | complete | Triggered when a mutation reaches required confirmations. +| CONFIRM | confirm | Triggered on each confirmation until the required confirmations are reached. +| ERROR | error | Triggered on mutation error. + +**Example:** + +```ts +mutation.on(MutationEvent.COMPLETE, () => { + console.log('Mutation has been completed!'); +}); +``` + +## Asset ledger + +Asset ledger represents ERC-721 related smart contract on the Wanchain blockchain. + +### AssetLedger(provider, ledgerId) + +A `class` which represents a smart contract on the Wanchain blockchain. + +**Arguments:** + +| Argument | Description +|-|- +| ledgerId | [required] A `string` representing an address of the ERC-721 related smart contract on the Wanchain blockchain. +| provider | [required] An instance of an HTTP provider. + +**Example:** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { AssetLedger } from '@0xcert/wanchain-asset-ledger'; + +// arbitrary data +const provider = new HttpProvider({ url: 'https://...' }); +const ledgerId = '0x...'; + +// create ledger instance +const ledger = new AssetLedger(provider, ledgerId); +``` + +### approveAccount(assetId, accountId) + +An `asynchronous` class instance `function` which approves a third-party `accountId` to take over a specific `assetId`. This function succeeds only when performed by the asset's owner. + +::: tip +Only one account per `assetId` can be approved at the same time thus running this function multiple times will override previously set data. +::: + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing an ID of an asset. +| accountId | [required] A `string` representing the new owner's Wanchain account address or an instance of the `OrderGateway` class. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; +const accountId = '0x...'; + +// perform mutation +const mutation = await ledger.approveAccount(assetId, accountId); +``` + +**See also:** + +[disapproveAccount](#disapprove-account), [approveOperator](#approve-operator) + +### approveOperator(accountId) + +An `asynchronous` class instance `function` which approves the third-party `accountId` to take over the management of all the assets of the account that performed this mutation. + +::: tip +Multiple operators can exist. +::: + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing a Wanchain account address or an instance of the `OrderGateway` class that will receive new management permissions on this ledger. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; +const accountId = '0x...'; + +// perform mutation +const mutation = await ledger.approveOperator(accountId); +``` + +**See also:** + +[disapproveOperator](#disapprove-operator), [approveAccount](#approve-account) + +### createAsset(recipe) + +An `asynchronous` class instance `function` which creates a new asset on the Wanchain blockchain. + +::: warning +The `CREATE_ASSET` ledger ability is needed to perform this function. +::: + +**Arguments:** + +| Argument | Description +|-|- +| recipe.id | [required] A `string` representing a unique asset ID. +| recipe.imprint | [required] A `string` representing asset imprint generated by using `Cert` class. +| recipe.receiverId | [required] A `string` representing a Wanchain account address that will receive the new asset. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const asset = { + id: '100', + imprint: 'd747e6ffd1aa3f83efef2931e3cc22c653ea97a32c1ee7289e4966b6964ecdfb', + receiverId: '0x...', +}; + +// perform mutation +const mutation = await ledger.createAsset(asset); +``` + +**See also:** + +[Cert](#cert) + +### deploy(provider, recipe) + +An `asynchronous` static class `function` which deploys a new asset ledger to the Wanchain blockchain. + +::: tip +All ledger abilities are automatically granted to the account that performs this method. +::: + +**Arguments:** + +| Argument | Description +|-|- +| provider | [required] An instance of an HTTP provider. +| recipe.name | [required] A `string` representing asset ledger name. +| recipe.symbol | [required] A `string` representing asset ledger symbol. +| recipe.uriBase | [required] A `string` representing base asset URI. +| recipe.schemaId | [required] A `string` representing data schema ID. +| recipe.capabilities | A list of `integers` which represent ledger capabilities. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { HttpProcider } from '@0xcert/wanchain-http-provider'; +import { AssetLedger, AssetLedgerCapability } from '@0xcert/wanchain-asset-ledger'; + +// arbitrary data +const provider = new HttpProvider({ + url: 'https://...', + accountId: '0x...' +}); +const capabilities = [ + AssetLedgerCapability.TOGGLE_TRANSFERS, +]; +const recipe = { + name: 'Math Course Certificate', + symbol: 'MCC', + uriBase: 'http://domain.com/assets/', + schemaId: '0x3f4a0870cd6039e6c987b067b0d28de54efea17449175d7a8cd6ec10ab23cc5d', // base asset schemaId + capabilities, +}; + +// perform mutation +const mutation = await AssetLedger.deploy(provider, recipe).then((mutation) => { + return mutation.complete(); // wait until first confirmation +}); +``` + +### destroyAsset(assetId) + +An `asynchronous` class instance `function` which destroys a specific `assetId` on the Wanchain blockchain. The asset is removed from the account and all queries about it will be invalid. The function succeeds only when performed by the asset's owner. This function is similar to `revokeAsset` but it differs in who can trigger it. + +::: warning +The `DESTROY_ASSET` ledger capability is needed to perform this function. +::: + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing the asset ID. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; + +// perform mutation +const mutation = await ledger.destroyAsset(assetId); +``` + +**See also:** + +[revokeAsset](#revokeasset-assetid) + +### disapproveAccount(assetId) + +An `asynchronous` class instance `function` which removes the ability of the currently set third-party account to take over a specific `assetId`. This function succeeds only when performed by the asset's owner. + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing the asset ID. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; + +// perform mutation +const mutation = await ledger.disapproveAccount(assetId); +``` + +**See also:** + +[disapproveOperator](#disapprove-operator), [approveAccount](#approve-account) + +### disapproveOperator(accountId) + +An `asynchronous` class instance `function` which removes the third-party `accountId` the ability of managing assets of the account that performed this mutation. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the new Wanchain account address or an instance of the `OrderGateway` class. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; + +// perform mutation +const mutation = await ledger.disapproveOperator(accountId); +``` + +**See also:** + +[disapproveAccount](#disapprove-account), [approveOperator](#approve-operator) + +### disableTransfers() + +An `asynchronous` class instance `function` which disables all asset transfers. + +::: warning +The `TOGGLE_TRANSFERS` ledger ability and `TOGGLE_TRANSFERS` ledger capability are required to perform this function. +::: + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// perform mutation +const mutation = await ledger.disableTransfers(); +``` + +**See also:** + +[enableTransfers](#enable-transfer) + +### enableTransfers() + +An `asynchronous` class instance `function` which enables all asset transfers. + +::: warning +The `TOGGLE_TRANSFERS` ledger ability and `TOGGLE_TRANSFERS` ledger capability are required to perform this function. +::: + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// perform mutation +const mutation = await ledger.enableTransfers(); +``` + +**See also:** + +[disableTransfers](#disable-transfers) + +### getAbilities(accountId) + +An `asynchronous` class instance `function` which returns `accountId` abilities. + +**Result:** + +An `array` of `integer` numbers representing account abilities. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; + +// perform query +const abilities = await ledger.getAbilities(accountId); +``` + +### getAccountAssetIdAt(accountId, index) + +An `asynchronous` class instance `function` which returns the asset ID at specified `index` for desired `accountId`. + +::: warning +The function might fail on some third party ERC721 contracts. If the token contract is not enumerable, this function will always return `null`. +::: + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the Wanchain account address. +| index | [required] A `number` representing the asset index. + +**Result:** + +A `number` representing the asset id. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; +const index = 0; // the account has 3 tokens on indexes 0, 1 and 2 + +// perform query +const assetId = await ledger.getAccountAssetIdAt(accountId, index); +``` + +### getApprovedAccount(assetId) + +An `asynchronous` class instance `function` which returns an account ID of a third party which is able to take over a specific `assetId`. + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing an asset ID. + +**Result:** + +A `string` representing account ID. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; + +// perform query +const accountId = await ledger.getApprovedAccount(assetId); +``` + +**See also:** + +[approveAccount](#approve-account) + +### getAsset(assetId) + +An `asynchronous` class instance `function` which returns `assetId` data. + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing the asset ID. + +**Result:** + +| Key | Description +|-|- +| id | A `string` representing asset ID. +| uri | A `string` representing asset URI which points to asset public metadata. +| imprint | A `string` representing asset imprint. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; + +// perform query +const data = await ledger.getAsset(assetId); +``` + +### getAssetAccount(assetId) + +An `asynchronous` class instance `function` which returns an account ID that owns the `assetId`. + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing the asset ID. + +**Result:** + +A `string` which represents an account ID. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; + +// perform query +const accountId = await ledger.getAssetAccount(assetId); +``` + +### getAssetIdAt(index) + +An `asynchronous` class instance `function` which returns the asset ID at specified `index`. + +::: warning +The function might fail on some third party ERC721 contracts. If the token contract is not enumerable, this function will always return `null`. +::: + +**Arguments:** + +| Argument | Description +|-|- +| index | [required] A `number` representing the asset index. + +**Result:** + +A `number` representing the asset ID. + +**Example:** + +```ts +// arbitrary data +const index = 0; // the contract holds 100 tokens on indexes 0 to 99 + +// perform query +const assetId = await ledger.getAssetIdAt(index); +``` + +### getBalance(accountId) + +An `asynchronous` class instance `function` which returns the number of assets owned by `accountId`. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the Wanchain account address. + +**Result:** + +An `integer` number representing the number of assets in the `accountId`. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; + +// perform query +const balance = await ledger.getBalance(accountId); +``` + +### getCapabilities() + +An `asynchronous` class instance `function` which returns ledger's capabilities. + +**Result:** + +An `array` of `integer` numbers representing ledger capabilities. + +**Example:** + +```ts +// perform query +const capabilities = await ledger.getCapabilities(); +``` + +### getInfo() + +An `asynchronous` class instance `function` that returns an object with general information about the ledger. + +**Result:** + +| Key | Description +|-|- +| name | A `string` representing asset ledger name. +| symbol | A `string` representing asset ledger symbol. +| uriBase | A `string` representing base asset URI. +| schemaId | A `string` representing data schema ID. +| supply | A big number `string` representing the total number of issued assets. + +**Example:** + +```ts +// perform query +const info = await ledger.getInfo(); +``` + +### getInstance(provider, ledgerId) + +A static class `function` that returns a new instance of the AssetLedger class (alias for `new AssetLedger`). + +**Arguments:** + +See the class [constructor](#asset-ledger) for details. + +**Example:** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { AssetLedger } from '@0xcert/wanchain-asset-ledger'; + +// arbitrary data +const provider = new HttpProvider({ url: 'https://...' }); +const ledgerId = '0x...'; + +// create ledger instance +const ledger = AssetLedger.getInstance(provider, ledgerId); +``` + +### id + +A class instance `variable` holding the address of ledger's smart contract on the Wanchain blockchain. + +### grantAbilities(accountId, abilities) + +An `asynchronous` class instance `function` which grants management permissions for this ledger to a third party `accountId`. + +::: warning +The `MANAGE_ABILITIES` super ability of the ledger is required to perform this function. +::: + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing a Wanchain account address or an instance of the `OrderGateway` class that will receive new management permissions on this ledger. +| abilities | [required] An array of `integers` representing this ledger's smart contract abilities. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { GeneralAssetLedgerAbility } from '@0xcert/wanchain-asset-ledger'; + +// arbitrary data +const accountId = '0x...'; +const abilities = [ + GeneralAssetLedgerAbility.CREATE_ASSET, + GeneralAssetLedgerAbility.TOGGLE_TRANSFERS, +]; + +// perform mutation +const mutation = await ledger.grantAbilities(accountId, abilities); +``` + +**See also:** + +[Ledger abilities](#ledger-abilities) +[revokeAbilities](#revokeabilities-accountid-abilities) + + +### isApprovedAccount(assetId, accountId) + +An `asynchronous` class instance `function` which returns `true` when the `accountId` has the ability to take over the `assetId`. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the Wanchain account address or an instance of the `OrderGateway` class. +| assetId | [required] A `string` representing an asset ID. + +**Result:** + +A `boolean` which tells if the `accountId` is approved for `assetId`. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; +const assetId = '100'; + +// perform query +const isApproved = await ledger.isApprovedAccount(assetId, accountId); +``` + +**See also:** + +[isApprovedOperator](#is-approved-operator), [approveAccount](#approve-account) + +### isApprovedOperator(accountId, operatorId) + +An `asynchronous` class instance `function` which returns `true` when the `accountId` has the ability to manage any asset of the `accountId`. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the Wanchain account address that owns assets. +| operatorId | [required] A `string` representing a third-party Wanchain account address or an instance of the `OrderGateway` class. + +**Result:** + +A `boolean` which tells if the `operatorId` can manage assets of `accountId`. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; +const operatorId = '0x...'; + +// perform query +const isOperator = await ledger.isApprovedOperator(accountId, operatorId); +``` + +**See also:** + +[isApprovedAccount](#is-approved-account), [approveAccount](#approve-account) + +### isTransferable() + +An `asynchronous` class instance `function` which returns `true` if the asset transfer feature on this ledger is enabled. + +::: warning +The `TOGGLE_TRANSFERS` ledger capability is required to perform this function. +::: + +**Result:** + +A `boolean` which tells if ledger asset transfers are enabled. + +**Example:** + +```ts +// perform query +const isTransferable = await ledger.isTransferable(); +``` + +**See also:** + +[enableTransfers](#enable-transfers) + +### revokeAbilities(accountId, abilities) + +An `asynchronous` class instance `function` which removes `abilities` of an `accountId`. + +::: warning +The `MANAGE_ABILITIES` super ability of the ledger is required to perform this function. +::: + +::: warning +You can revoke your own `MANAGE_ABILITIES` super ability. +::: + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the new Wanchain account address. +| abilities | [required] An `array` of `integer` numbers representing ledger abilities. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { GeneralAssetLedgerAbility } from '@0xcert/wanchain-asset-ledger'; + +// arbitrary data +const accountId = '0x...'; +const abilities = [ + GeneralAssetLedgerAbility.CREATE_ASSET, + GeneralAssetLedgerAbility.TOGGLE_TRANSFERS, +]; + +// perform mutation +const mutation = await ledger.revokeAbilities(accountId, abilities); +``` + +**See also:** + +[Ledger abilities](#ledger-abilities) +[grantAbilities](#grantabilities-accountid-abilities) + +### revokeAsset(assetId) + +An `asynchronous` class instance `function` which destroys a specific `assetId` of an account. The asset is removed from the account and all queries about it will be invalid. The function is ment to be used by ledger owners to destroy assets of other accounts. This function is similar to `destroyAsset` but it differs in who can trigger it. + +::: warning +The `REVOKE_ASSET` ledger capability is needed to perform this function. +::: + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing the asset ID. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; + +// perform mutation +const mutation = await ledger.revokeAsset(assetId); +``` + +**See also:** + +[destroyAsset](#destroyasset-assetid) + +### update(recipe) + +An `asynchronous` class instance `function` which updates ledger data. + +::: warning +You need `UPDATE_URI_BASE` ledger ability to update ledger's `uriBase` property. +::: + +**Arguments:** + +| Argument | Description +|-|- +| recipe.uriBase | [required] A `string` representing ledger URI base property. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const recipe = { + uriBase: 'https://0xcert.com/asset/', +}; + +// perform mutation +const mutation = await ledger.update(recipe); +``` + +**See also:** + +[updateAsset](#update-asset) + +### updateAsset(assetId, recipe) + +An `asynchronous` class instance `function` which updates `assetId` data. + +::: warning +You need `UPDATE_ASSET_IMPRINT` ledger capability and `UPDATE_ASSET` ledger ability to update asset `imprint` property. +::: + +**Arguments:** + +| Argument | Description +|-|- +| assetId | [required] A `string` representing an ID of an asset. +| recipe.imprint | [required] A `string` representing asset imprint property. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const assetId = '100'; +const recipe = { + imprint: 'd747e6ffd1aa3f83efef2931e3cc22c653ea97a32c1ee7289e4966b6964ecdfb', +}; + +// perform mutation +const mutation = await ledger.updateAsset(assetId, recipe); +``` + +**See also:** + +[update](#update) + +### transferAsset(recipe) + +An `asynchronous` class instance `function` which transfers asset to another account. + +**Arguments:** + +| Argument | Description +|-|- +| recipe.senderId | A `string` representing the account ID that will send the asset. Defaults to account that is making the mutation. +| recipe.receiverId | [required] A `string` representing the account ID that will receive the asset. +| recipe.id | [required] A `string` representing asset ID. +| recipe.data | A `string` representing some arbitrary mutation note. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const recipe = { + receiverId: '0x...', + id: '100', +}; + +// perform mutation +const mutation = await ledger.transferAsset(recipe); +``` + +## Ledger abilities + +Ledger abilities represent account-level permissions. For optimization reasons abilities are managed as bitfields for that reason enums are values of 2**n. +We have two categories of abilities, general and super. General abilities are abilities that can not change other account's abilities whereas super abilities can. +This categorization is for safety purposes since revoking your own super ability can lead to unintentional loss of control. + +**Super abilities options:** + +| Name | Value | Description +|-|-|- +| MANAGE_ABILITIES | 1 | Allows an account to further grant abilities. + +**General abilities options:** + +| Name | Value | Description +|-|-|- +| ALLOW_CREATE_ASSET | 32 | A specific ability that is bounded to atomic orders. When creating a new asset trough `OrderGateway`, the order maker has to have this ability. +| CREATE_ASSET | 2 | Allows an account to create a new asset. +| REVOKE_ASSET | 4 | Allows management accounts to revoke assets. +| TOGGLE_TRANSFERS | 8 | Allows an account to stop and start asset transfers. +| UPDATE_ASSET | 16 | Allows an account to update asset data. +| UPDATE_URI_BASE | 64 | Allows an account to update asset ledger's base URI. + +**Example:** + +```ts +import { GeneralAssetLedgerAbility } from '@0xcert/wanchain-asset-ledger'; +import { SuperAssetLedgerAbility } from '@0xcert/wanchain-asset-ledger'; + +const abilities = [ + SuperAssetLedgerAbility.MANAGE_ABILITIES, + GeneralAssetLedgerAbility.TOGGLE_TRANSFERS, +]; +``` + +**See also:** + +[grantAbilities](#grantabilities-accountid-abilities) +[revokeAbilities](#revokeabilities-accountid-abilities) + +## Ledger capabilities + +Ledger capabilities represent the features of a smart contract. + +**Options:** + +| Name | Value | Description +|-|-|- +| DESTROY_ASSET | 1 | Enables asset owners to destroy their assets. +| UPDATE_ASSET | 2 | Enables ledger managers to update asset data. +| REVOKE_ASSET | 4 | Enables ledger managers to revoke assets. +| TOGGLE_TRANSFERS | 3 | Enables ledger managers to start and stop asset transfers. + +**Example:** + +```ts +import { AssetLedgerCapability } from '@0xcert/wanchain-asset-ledger'; + +const capabilities = [ + AssetLedgerCapability.TOGGLE_TRANSFERS, +]; +``` + +## Value ledger + +Value ledger represents an ERC-20 related smart contract on the Wanchain blockchain. + +### ValueLedger(provider, ledgerId) + +A `class` which represents a smart contract on the Wanchain blockchain. + +**Arguments:** + +| Argument | Description +|-|- +| ledgerId | [required] A string representing an address of the ERC-20 related smart contract on the Wanchain blockchain. +| provider | [required] An instance of an HTTP provider. + +**Example:** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { ValueLedger } from '@0xcert/wanchain-value-ledger'; + +// arbitrary data +const provider = new HttpProvider({ url: 'https://...' }); +const ledgerId = '0x...'; + +// create ledger instance +const ledger = new ValueLedger(provider, ledgerId); +``` + +### approveValue(value, accountId) + +An `asynchronous` class instance `function` which approves a third-party `accountId` to transfer a specific `value`. This function succeeds only when performed by the asset's owner. Multiple accounts can be approved for different values at the same time. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing an account address or an instance of the `OrderGateway` class. +| value | [required] An `integer` number representing the approved amount. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const value = '1000000000000000000'; // 1 unit (18 decimals) +const accountId = '0x...'; + +// perform mutation +const mutation = await ledger.approveValue(value, accountId); +``` + +**See also:** + +[disapproveValue](#disapprove-value) + +### deploy(provider, recipe) + +An `asynchronous` static class `function` which deploys a new value ledger to the Wanchain blockchain. + +**Arguments:** + +| Argument | Description +|-|- +| provider | [required] An instance of an HTTP provider. +| recipe.name | [required] A `string` representing value ledger name. +| recipe.symbol | [required] A `string` representing value ledger symbol. +| recipe.decimals | [required] A big number `string` representing the number of decimals. +| recipe.supply | [required] A big number `string` representing the total supply of a ledger. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { ValueLedger } from '@0xcert/wanchain-value-ledger'; + +// arbitrary data +const provider = new HttpProvider({ + url: 'https://...', + accountId: '0x...' +}); +const recipe = { + name: 'Utility token', + symbol: 'UCC', + decimal: '18', + supply: '500000000000000000000', // 500 mio +}; + +// perform mutation +const mutation = await ValueLedger.deploy(provider, recipe).then((mutation) => { + return mutation.complete(); // wait until first confirmation +}); +``` + +### disapproveValue(accountId) + +An `asynchronous` class instance `function` which removes the ability of a third-party account to transfer value. Note that this function succeeds only when performed by the value owner. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the accountId who will be disapproved. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; + +// perform mutation +const mutation = await ledger.disapproveValue(accountId); +``` + +**See also:** + +[approveValue](#approve-value) + +### getApprovedValue(accountId, spenderId) + +An `asynchronous` class instance `function` which returns the approved value that the `spenderId` is able to transfer for `accountId`. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the holder's account ID. +| spenderId | [required] A `string` representing the account ID of a spender or an instance of the `OrderGateway` class. + +**Result:** + +A big number `string` representing the approved value. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; +const spenderId = '0x...'; + +// perform query +const value = await ledger.getApprovedValue(accountId, spenderId); +``` + +**See also:** + +[approveValue](#approve-value) + +### getBalance(accountId) + +An `asynchronous` class instance `function` which returns the total posessed amount of the `accountId`. + +**Arguments:** + +| Argument | Description +|-|- +| accountId | [required] A `string` representing the Wanchain account address. + +**Result:** + +A big number `string` representing the total value of the `accountId`. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; + +// perform query +const balance = await ledger.getBalance(accountId); +``` + +### getInfo() + +An `asynchronous` class instance `function` that returns an object with general information about the ledger. + +**Result:** + +| Key | Description +|-|- +| name | A `string` representing value ledger name. +| symbol | A `string` representing value ledger symbol. +| decimals | [required] A big number of `strings` representing the number of decimals. +| supply | [required] A big number `string` representing the ledger total supply. + +**Example:** + +```ts +// perform query +const info = await ledger.getInfo(); +``` + +### getInstance(provider, id) + +A static class `function` that returns a new instance of the ValueLedger class (alias for `new ValueLedger`). + +**Arguments** + +See the class [constructor](#value-ledger) for details. + +**Usage** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { ValueLedger } from '@0xcert/wanchain-value-ledger'; + +// arbitrary data +const provider = new HttpProvider({ url: 'https://...' }); +const ledgerId = '0x...'; + +// create ledger instance +const ledger = ValueLedger.getInstance(provider, ledgerId); +``` + +### id + +A class instance `variable` holding the address of ledger's smart contract on the Wanchain blockchain. + +### isApprovedValue(value, accountId, spenderId) + +An `asynchronous` class instance `function` which returns `true` when the `spenderId` has the ability to transfer the `value` from an `accountId`. + +**Arguments:** + +| Argument | Description +|-|-|- +| accountId | [required] A `string` representing the Wanchain account address that owns the funds. +| spenderId | [required] A `string` representing the approved Wanchain account address or an instance of the `OrderGateway` class. +| value | [required] A big number `string` representing the amount allowed to transfer. + +**Result:** + +A `boolean` which tells if the `spenderId` is approved to move `value` from `accountId`. + +**Example:** + +```ts +// arbitrary data +const accountId = '0x...'; +const spenderId = '0x...'; +const value = '1000000000000000000'; + +// perform query +const isApproved = await ledger.isApprovedAccount(value, accountId, spenderId); +``` + +**See also:** + +[approveValue](#approve-value) + +### transferValue(recipe) + +An `asynchronous` class instance `function` which transfers asset to another account. + +**Arguments:** + +| Argument | Description +|-|- +| recipe.receiverId | [required] A `string` representing account ID that will receive the value. +| recipe.senderId | A `string` representing account ID that will send the value. It defaults to provider's accountId. +| recipe.value | [required] A big number `string` representing the transferred amount. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const recipe = { + receiverId: '0x...', + value: '1000000000000000000', // 1 unit (18 decimals) +}; + +// perform mutation +const mutation = await ledger.transferValue(recipe); +``` + +## Orders gateway + +Order gateway allows for performing multiple actions in one single atomic operation. + +### OrderGateway(provider, gatewayId) + +A `class` which represents a smart contract on the Wanchain blockchain. + +**Arguments** + +| Argument | Description +|-|- +| gatewayId | [required] A `string` representing an address of the [0xcert order gateway smart contract](#public-addresses) on the Wanchain blockchain. +| provider | [required] An instance of an HTTP provider. + +**Usage** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { OrderGateway } from '@0xcert/wanchain-order-gateway'; + +// arbitrary data +const provider = new HttpProvider({ url: 'https://...' }); +const gatewayId = '0x...'; + +// create ledger instance +const gateway = new OrderGateway(provider, gatewayId); +``` + +### cancel(order) + +An `asynchronous` class instance `function` which marks the provided `order` as canceled. This prevents the `order` to be performed. + +**Arguments:** + +| Argument | Description +|-|- +| order.actions | [required] An `array` of [action objects](#order-actions). +| order.expiration | [required] An `integer` number representing the timestamp in milliseconds at which the order expires and can not be performed any more. +| order.makerId | [required] A `string` representing the Wanchain account address which makes the order. It defaults to the `accountId` of a provider. +| order.seed | [required] An `integer` number representing the unique order number. +| order.takerId | [required] A `string` representing the Wanchain account address which will be able to perform the order on the blockchain. This account also pays for the gas cost. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +import { OrderActionKind } from '@0xcert/wanchain-order-gateway'; + +// arbitrary data +const order = { + actions: [ + { + kind: OrderActionKind.TRANSFER_ASSET, + ledgerId: '0x...', + senderId: '0x...', + receiverId: '0x...', + assetId: '100', + }, + ], + expiration: Date.now() + 60 * 60 * 24, // 1 day + seed: 12345, + takerId: '0x...', +}; + +// perform mutation +const mutation = await gateway.cancel(order); +``` + +**See also:** + +[claim](#claim), [perform](#perform) + +### claim(order) + +An `asynchronous` class instance `function` which cryptographically signes the provided `order` and returns a signature. + +::: warning +This operation must be executed by the maker of the order. +::: + +**Arguments:** + +| Argument | Description +|-|- +| order.actions | [required] An `array` of [action objects](#order-actions). +| order.expiration | [required] An `integer` number representing the timestamp in milliseconds at which the order expires and can not be performed any more. +| order.makerId | [required] A `string` representing a Wanchain account address which makes the order. It defaults to the `accountId` of a provider. +| order.seed | [required] An `integer` number representing the unique order number. +| order.takerId | [required] A `string` representing the Wanchain account address which will be able to perform the order on the blockchain. This account also pays the gas cost. + +**Result:** + +A `string` representing order signature. + +**Example:** + +```ts +// arbitrary data +const order = { + actions: [ + { + kind: OrderActionKind.TRANSFER_ASSET, + ledgerId: '0x...', + senderId: '0x...', + receiverId: '0x...', + assetId: '100', + }, + ], + expiration: Date.now() + 60 * 60 * 24, // 1 day + seed: 12345, + takerId: '0x...', +}; + +// perform query +const signature = await gateway.claim(order); +``` + +### getInstance(provider, id) + +A static class `function` that returns a new instance of the `OrderGateway` class (alias for `new OrderGateway`). + +**Arguments** + +See the class [constructor](#order-gateway) for details. + +**Usage** + +```ts +import { HttpProvider } from '@0xcert/wanchain-http-provider'; +import { OrderGateway } from '@0xcert/wanchain-order-gateway'; + +// arbitrary data +const provider = new HttpProvider({ url: 'https://...' }); +const gatewayId = '0x...'; + +// create gateway instance +const gateway = OrderGateway.getInstance(provider, gatewayId); +``` + +### id + +A class instance `variable` holding the address of gateway's smart contract on the Wanchain blockchain. + +### perform(order, signature) + +An `asynchronous` class instance `function` which submits the `order` with `signature` from the maker. + +::: warning +This operation must be executed by the taker of the order. +::: + +**Arguments:** + +| Argument | Description +|-|- +| signature | [required] A `string` representing order signature created by the maker. +| order.actions | [required] An `array` of [action objects](#order-actions). +| order.expiration | [required] An `integer` number representing the timestamp in milliseconds at which the order expires and can not be performed any more. +| order.makerId | [required] A `string` representing a Wanchain account address which makes the order. It defaults to the `accountId` of a provider. +| order.seed | [required] An `integer` number representing the unique order number. +| order.takerId | [required] A `string` representing the Wanchain account address which will be able to perform the order on the blockchain. This account also pays the gas cost. + +**Result:** + +An instance of the same mutation class. + +**Example:** + +```ts +// arbitrary data +const signature = 'fe3ea95fa6bda2001c58fd13d5c7655f83b8c8bf225b9dfa7b8c7311b8b68933'; +const order = { + actions: [ + { + kind: OrderActionKind.TRANSFER_ASSET, + ledgerId: '0x...', + senderId: '0x...', + receiverId: '0x...', + assetId: '100', + }, + ], + expiration: Date.now() + 60 * 60 * 24, // 1 day + seed: 12345, + takerId: '0x...', +}; + +// perform mutation +const mutation = await gateway.perform(order, signature); +``` + +**See also:** + +[cancel](#cancel) + +## Order actions + +Order actions define the atomic operations of the order gateway. + +**Options:** + +| Name | Value | Description +|-|-|- +| CREATE_ASSET | 1 | Create a new asset. +| TRANSFER_ASSET | 2 | Transfer an asset. +| TRANSFER_VALUE | 3 | Transfer a value. + +### Create asset action + +| Property | Description +|-|-|- +| assetId | [required] A `string` representing an ID of an asset. +| assetImprint | [required] A `string` representing a cryptographic imprint of an asset. +| kind | [required] An `integer` number that equals to `OrderActionKind.CREATE_ASSET`. +| ledgerId | [required] A `string` representing asset ledger address. +| receiverId | [required] A `string` representing receiver's address. +| senderId | [required] A `string` representing sender's address. + +### Transfer asset action + +| Property | Description +|-|-|- +| assetId | [required] A `string` representing an ID of an asset. +| kind | [required] An `integer` number that equals to `OrderActionKind.TRANSFER_ASSET`. +| ledgerId | [required] A `string` representing asset ledger address. +| receiverId | [required] A `string` representing receiver's address. +| senderId | [required] A `string` representing sender's address. + +### Transfer value action + +| Property | Description +|-|-|- +| kind | [required] An `integer` number that equals to `OrderActionKind.TRANSFER_VALUE`. +| ledgerId | [required] A `string` representing asset ledger address. +| receiverId | [required] A `string` representing receiver's address. +| senderId | [required] A `string` representing sender's address. +| value | [required] A big number `string` representing the transferred amount. + +## Public addresses + +### Mainnet + +| Contract | Address +|-|-|- + +Coming soon. + +### Testnet + +| Contract | Address +|-|-|- +| OrderGateway | [0xCbD15dFc9fb38E3283f5c122CF94eA0767b45714](http://47.104.61.26/block/addr/0xCbD15dFc9fb38E3283f5c122CF94eA0767b45714) +| TokenTransferProxy | [0xB827222B89BA5237c432c47B4ef7d2079641A075](http://47.104.61.26/block/addr/0xB827222B89BA5237c432c47B4ef7d2079641A075) +| NFTokenTransferProxy | [0xB59A801024393eB92b38a0711a54579c0136347A](http://47.104.61.26/block/addr/0xB59A801024393eB92b38a0711a54579c0136347A) +| NFTokenSafeTransferProxy | [0x84907deF46A2D0fc80035f1c08A722f2432e9801](http://47.104.61.26/block/addr/0x84907deF46A2D0fc80035f1c08A722f2432e9801) +| XcertCreateProxy | [0xB56F60874aCC5a0b0D318Bf7D15A63CA0122118D](http://47.104.61.26/block/addr/0xB56F60874aCC5a0b0D318Bf7D15A63CA0122118D) diff --git a/docs/index.md b/docs/index.md index 2097325c3..bfee60714 100644 --- a/docs/index.md +++ b/docs/index.md @@ -48,4 +48,5 @@ pageClass: homepage

Supported blockchains:

+
diff --git a/packages/0xcert-cert/CHANGELOG.md b/packages/0xcert-cert/CHANGELOG.md index 5627eb274..aace0ca2e 100644 --- a/packages/0xcert-cert/CHANGELOG.md +++ b/packages/0xcert-cert/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-conventions/CHANGELOG.md b/packages/0xcert-conventions/CHANGELOG.md index 2de90e115..25fa6af83 100644 --- a/packages/0xcert-conventions/CHANGELOG.md +++ b/packages/0xcert-conventions/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md index 8469c960e..632608b52 100644 --- a/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-asset-ledger/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts index 9f089f197..10033c351 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/core/ledger.ts @@ -1,5 +1,5 @@ import { GenericProvider, Mutation } from '@0xcert/ethereum-generic-provider'; -import { bigNumberify, normalizeAddress } from '@0xcert/ethereum-utils'; +import { bigNumberify } from '@0xcert/ethereum-utils'; import { AssetLedgerAbility, AssetLedgerBase, AssetLedgerCapability, AssetLedgerDeployRecipe, AssetLedgerInfo, AssetLedgerItem, AssetLedgerItemRecipe, AssetLedgerObjectUpdateRecipe, AssetLedgerTransferRecipe, @@ -59,7 +59,7 @@ export class AssetLedger implements AssetLedgerBase { * @param id Address of the erc721/Xcert smart contract. */ public static getInstance(provider: GenericProvider, id: string): AssetLedger { - return new AssetLedger(provider, id); + return new this(provider, id); } /** @@ -68,8 +68,8 @@ export class AssetLedger implements AssetLedgerBase { * @param id Address of the erc721/Xcert smart contract. */ public constructor(provider: GenericProvider, id: string) { - this._id = normalizeAddress(id); this._provider = provider; + this._id = this._provider.encoder.normalizeAddress(id); } /** @@ -91,7 +91,7 @@ export class AssetLedger implements AssetLedgerBase { * @param accountId Account address for wich we want to get abilities. */ public async getAbilities(accountId: string): Promise { - accountId = normalizeAddress(accountId); + accountId = this._provider.encoder.normalizeAddress(accountId); return getAbilities(this, accountId); } @@ -125,7 +125,7 @@ export class AssetLedger implements AssetLedgerBase { * @param accountId Address for which we want asset count. */ public async getBalance(accountId: string): Promise { - accountId = normalizeAddress(accountId); + accountId = this._provider.encoder.normalizeAddress(accountId); return getBalance(this, accountId); } @@ -158,7 +158,7 @@ export class AssetLedger implements AssetLedgerBase { * @param index Asset index. */ public async getAccountAssetIdAt(accountId: string, index: number): Promise { - accountId = normalizeAddress(accountId); + accountId = this._provider.encoder.normalizeAddress(accountId); return getAccountAssetIdAt(this, accountId, index); } @@ -173,7 +173,7 @@ export class AssetLedger implements AssetLedgerBase { accountId = await (accountId as any).getProxyAccountId(this.getProxyId()); } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); return accountId === await getApprovedAccount(this, assetId); } @@ -195,7 +195,7 @@ export class AssetLedger implements AssetLedgerBase { accountId = await (accountId as any).getProxyAccountId(this.getProxyId()); } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); return approveAccount(this, accountId, assetId); } @@ -218,7 +218,7 @@ export class AssetLedger implements AssetLedgerBase { accountId = await (accountId as any).getProxyAccountId(0); // OrderGatewayProxy.XCERT_CREATE } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); let bitAbilities = bigNumberify(0); abilities.forEach((ability) => { @@ -234,7 +234,7 @@ export class AssetLedger implements AssetLedgerBase { */ public async createAsset(recipe: AssetLedgerItemRecipe): Promise { const imprint = recipe.imprint || 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'; - const receiverId = normalizeAddress(recipe.receiverId); + const receiverId = this._provider.encoder.normalizeAddress(recipe.receiverId); return createAsset(this, receiverId, recipe.id, `0x${imprint}`); } @@ -262,7 +262,7 @@ export class AssetLedger implements AssetLedgerBase { allowSuperRevoke = true; } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); let bitAbilities = bigNumberify(0); abilities.forEach((ability) => { @@ -289,8 +289,8 @@ export class AssetLedger implements AssetLedgerBase { recipe.senderId = this.provider.accountId; } - const senderId = normalizeAddress(recipe.senderId); - const receiverId = normalizeAddress(recipe.receiverId); + const senderId = this._provider.encoder.normalizeAddress(recipe.senderId); + const receiverId = this._provider.encoder.normalizeAddress(recipe.receiverId); return this.provider.unsafeRecipientIds.indexOf(recipe.receiverId) !== -1 ? transfer(this, senderId, receiverId, recipe.id) @@ -337,7 +337,7 @@ export class AssetLedger implements AssetLedgerBase { accountId = await (accountId as any).getProxyAccountId(this.getProxyId()); } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); return setApprovalForAll(this, accountId, true); } @@ -351,7 +351,7 @@ export class AssetLedger implements AssetLedgerBase { accountId = await (accountId as any).getProxyAccountId(this.getProxyId()); } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); return setApprovalForAll(this, accountId, false); } @@ -366,8 +366,8 @@ export class AssetLedger implements AssetLedgerBase { operatorId = await (operatorId as any).getProxyAccountId(this.getProxyId()); } - accountId = normalizeAddress(accountId); - operatorId = normalizeAddress(operatorId as string); + accountId = this._provider.encoder.normalizeAddress(accountId); + operatorId = this._provider.encoder.normalizeAddress(operatorId as string); return isApprovedForAll(this, accountId, operatorId); } diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/approve-account.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/approve-account.ts index 2d5435d94..a74b3f56a 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/approve-account.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/approve-account.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x095ea7b3'; @@ -15,7 +14,7 @@ export default async function(ledger: AssetLedger, accountId: string, assetId: s const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, assetId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/create-asset.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/create-asset.ts index f9e3caa87..091a08bc1 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/create-asset.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/create-asset.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xb0e329e4'; @@ -16,7 +15,7 @@ export default async function(ledger: AssetLedger, receiverId: string, id: strin const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [receiverId, id, imprint]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [receiverId, id, imprint]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/deploy.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/deploy.ts index 761ffd14c..8e387a3de 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/deploy.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/deploy.ts @@ -1,5 +1,4 @@ import { GenericProvider, Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedgerDeployRecipe } from '@0xcert/scaffold'; import { fetch } from '@0xcert/utils'; import { getInterfaceCode } from '../lib/capabilities'; @@ -17,7 +16,7 @@ export default async function(provider: GenericProvider, { name, symbol, uriBase const codes = (capabilities || []).map((c) => getInterfaceCode(c)); const attrs = { from: provider.accountId, - data: `0x${source}${encodeParameters(inputTypes, [name, symbol, uriBase, schemaId, codes]).substr(2)}`, + data: `0x${source}${provider.encoder.encodeParameters(inputTypes, [name, symbol, uriBase, schemaId, codes]).substr(2)}`, }; const res = await provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/destroy-asset.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/destroy-asset.ts index 178d0e498..024c9bb61 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/destroy-asset.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/destroy-asset.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x9d118770'; @@ -14,7 +13,7 @@ export default async function(ledger: AssetLedger, assetId: string) { const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [assetId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/grant-abilities.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/grant-abilities.ts index 325ade3ba..3fb3e4b75 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/grant-abilities.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/grant-abilities.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x0ab319e8'; @@ -15,7 +14,7 @@ export default async function(ledger: AssetLedger, accountId: string, abilities: const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, abilities]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, abilities]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-abilities.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-abilities.ts index d8c85a2f7..3b3108703 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-abilities.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-abilities.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xaca910e7'; @@ -16,7 +15,7 @@ export default async function(ledger: AssetLedger, accountId: string, abilities: const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, abilities, allowSuperRevoke]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, abilities, allowSuperRevoke]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-asset.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-asset.ts index 97d1f74b8..9364f2d5b 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-asset.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/revoke-asset.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x20c5429b'; @@ -15,7 +14,7 @@ export default async function(ledger: AssetLedger, assetId: string) { const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [assetId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/safe-transfer.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/safe-transfer.ts index d48dd52bf..b73cfcac3 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/safe-transfer.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/safe-transfer.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; /** @@ -23,7 +22,7 @@ export default async function(ledger: AssetLedger, senderId: string, receiverId const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, data).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, data).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/set-approval-for-all.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/set-approval-for-all.ts index 669750eb1..0acd72a4d 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/set-approval-for-all.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/set-approval-for-all.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xa22cb465'; @@ -15,7 +14,7 @@ export default async function(ledger: AssetLedger, accountId: string, approved: const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, approved]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, approved]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/set-enabled.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/set-enabled.ts index e3815af25..a72348c9f 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/set-enabled.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/set-enabled.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xbedb86fb'; @@ -14,7 +13,7 @@ export default async function(ledger: AssetLedger, enabled: boolean) { const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [!enabled]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [!enabled]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/transfer.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/transfer.ts index 75d6f4949..8eff2e439 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/transfer.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/transfer.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x23b872dd'; @@ -15,7 +14,7 @@ export default async function(ledger: AssetLedger, senderId: string, receiverId: const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [senderId, receiverId, id]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [senderId, receiverId, id]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/update-asset.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/update-asset.ts index 95d2d6460..8b3c6ba74 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/update-asset.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/update-asset.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xbda0e852'; @@ -15,7 +14,7 @@ export default async function(ledger: AssetLedger, assetId: string, imprint: str const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [assetId, imprint]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [assetId, imprint]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/mutations/update.ts b/packages/0xcert-ethereum-asset-ledger/src/mutations/update.ts index f6ea92d3c..f49b116fc 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/mutations/update.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/mutations/update.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x27fc0cff'; @@ -14,7 +13,7 @@ export default async function(ledger: AssetLedger, uriBase: string) { const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [uriBase]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [uriBase]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-abilities.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-abilities.ts index 84f02ba18..e166afa3b 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-abilities.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-abilities.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { GeneralAssetLedgerAbility, SuperAssetLedgerAbility } from '@0xcert/scaffold'; import { AssetLedger } from '../core/ledger'; @@ -23,13 +22,13 @@ export default async function(ledger: AssetLedger, accountId: string) { ].map(async (ability) => { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, ability]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, ability]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0] ? ability : -1; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0] ? ability : -1; }), ).then((abilities) => { return abilities.filter((a) => a !== -1).sort((a, b) => a - b); diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-account-asset-id-at.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-account-asset-id-at.ts index 01976a25f..53878b572 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-account-asset-id-at.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-account-asset-id-at.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x2f745c59'; @@ -15,13 +14,13 @@ export default async function(ledger: AssetLedger, accountId: string, index: num try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, index]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, index]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-approved-account.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-approved-account.ts index c8a8db67c..08045a8df 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-approved-account.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-approved-account.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; import kittyIndexToApproved from './kitty-index-to-approved'; @@ -15,13 +14,13 @@ export default async function(ledger: AssetLedger, assetId: string) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [assetId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return kittyIndexToApproved(ledger, assetId); } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-account.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-account.ts index 437c94da5..372800355 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-account.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-account.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x6352211e'; @@ -14,13 +13,13 @@ export default async function(ledger: AssetLedger, assetId: string) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [assetId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-id-at.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-id-at.ts index 7a236e93e..c3190e0fd 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-id-at.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset-id-at.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x4f6ccce7'; @@ -14,13 +13,13 @@ export default async function(ledger: AssetLedger, index: number) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [index]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [index]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset.ts index 311544c3a..e9b305f3e 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-asset.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functions = [ @@ -25,13 +24,13 @@ export default async function(ledger: AssetLedger, assetId: string) { try { const attrs = { to: ledger.id, - data: f.signature + encodeParameters(f.inputTypes, [assetId]).substr(2), + data: f.signature + ledger.provider.encoder.encodeParameters(f.inputTypes, [assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(f.outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(f.outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-balance.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-balance.ts index d81042242..5b128fe96 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-balance.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-balance.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x70a08231'; @@ -14,13 +13,13 @@ export default async function(ledger: AssetLedger, accountId: string) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0].toString(); + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0].toString(); } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-capabilities.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-capabilities.ts index 0b4bf5172..1080be38b 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-capabilities.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-capabilities.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedgerCapability } from '@0xcert/scaffold'; import { AssetLedger } from '../core/ledger'; import { getInterfaceCode } from '../lib/capabilities'; @@ -21,13 +20,13 @@ export default async function(ledger: AssetLedger) { const code = getInterfaceCode(capability); const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [code]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [code]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0] ? capability : -1; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0] ? capability : -1; }), ).then((abilities) => { return abilities.filter((a) => a !== -1).sort() as AssetLedgerCapability[]; diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/get-info.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/get-info.ts index e1e5098e7..1061a8255 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/get-info.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/get-info.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functions = [ @@ -39,13 +38,13 @@ export default async function(ledger: AssetLedger) { try { const attrs = { to: ledger.id, - data: f.signature + encodeParameters(f.inputTypes, []).substr(2), + data: f.signature + ledger.provider.encoder.encodeParameters(f.inputTypes, []).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(f.outputTypes, res.result)[0].toString(); + return ledger.provider.encoder.decodeParameters(f.outputTypes, res.result)[0].toString(); } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/is-approved-for-all.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/is-approved-for-all.ts index a254c5891..6f1b2d98e 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/is-approved-for-all.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/is-approved-for-all.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xe985e9c5'; @@ -15,13 +14,13 @@ export default async function(ledger: AssetLedger, accountId: string, operatorId try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, operatorId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, operatorId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/is-enabled.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/is-enabled.ts index 886ec17ab..a42996875 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/is-enabled.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/is-enabled.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0xb187bd26'; @@ -13,13 +12,13 @@ export default async function(ledger: AssetLedger) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, []).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, []).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return !decodeParameters(outputTypes, res.result)[0]; + return !ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-asset-ledger/src/queries/kitty-index-to-approved.ts b/packages/0xcert-ethereum-asset-ledger/src/queries/kitty-index-to-approved.ts index 289ff6357..6726206e6 100644 --- a/packages/0xcert-ethereum-asset-ledger/src/queries/kitty-index-to-approved.ts +++ b/packages/0xcert-ethereum-asset-ledger/src/queries/kitty-index-to-approved.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { AssetLedger } from '../core/ledger'; const functionSignature = '0x481af3d3'; @@ -14,13 +13,13 @@ export default async function(ledger: AssetLedger, assetId: string) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [assetId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [assetId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md index 53eb126c5..80ba1420b 100644 --- a/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc20-contracts/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md index 1267f4885..a86a40651 100644 --- a/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-erc721-contracts/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md index 651bbbb7a..a477a6412 100644 --- a/packages/0xcert-ethereum-generic-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-generic-provider/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-generic-provider/src/core/provider.ts b/packages/0xcert-ethereum-generic-provider/src/core/provider.ts index c4b55b859..3597be82d 100644 --- a/packages/0xcert-ethereum-generic-provider/src/core/provider.ts +++ b/packages/0xcert-ethereum-generic-provider/src/core/provider.ts @@ -1,4 +1,4 @@ -import { normalizeAddress } from '@0xcert/ethereum-utils'; +import { Encode, Encoder } from '@0xcert/ethereum-utils'; import { ProviderBase, ProviderEvent } from '@0xcert/scaffold'; import { EventEmitter } from 'events'; import { parseError } from './errors'; @@ -53,6 +53,11 @@ export interface GenericProviderOptions { * The number of milliseconds in which a mutation times out. */ mutationTimeout?: number; + + /** + * Encoder instance. + */ + encoder?: Encode; } /** @@ -85,6 +90,11 @@ export class GenericProvider extends EventEmitter implements ProviderBase { */ public mutationTimeout: number; + /** + * Instance of encoder. + */ + public encoder: Encode; + /** * Id (address) of order gateway. */ @@ -117,6 +127,7 @@ export class GenericProvider extends EventEmitter implements ProviderBase { */ public constructor(options: GenericProviderOptions) { super(); + this.encoder = typeof options.encoder !== 'undefined' ? options.encoder : new Encoder(); this.accountId = options.accountId; this.orderGatewayId = options.orderGatewayId; this.unsafeRecipientIds = options.unsafeRecipientIds; @@ -142,7 +153,7 @@ export class GenericProvider extends EventEmitter implements ProviderBase { * Sets and normalizes account ID. */ public set accountId(id: string) { - id = normalizeAddress(id); + id = this.encoder.normalizeAddress(id); if (!this.isCurrentAccount(id)) { this.emit(ProviderEvent.ACCOUNT_CHANGE, id, this._accountId); // must be before the new account is set @@ -162,7 +173,7 @@ export class GenericProvider extends EventEmitter implements ProviderBase { * Sets and normalizes unsafe recipient IDs. */ public set unsafeRecipientIds(ids: string[]) { - this._unsafeRecipientIds = (ids || []).map((id) => normalizeAddress(id)); + this._unsafeRecipientIds = (ids || []).map((id) => this.encoder.normalizeAddress(id)); } /** @@ -176,7 +187,7 @@ export class GenericProvider extends EventEmitter implements ProviderBase { * Sets and normalizes account ID. */ public set orderGatewayId(id: string) { - this._orderGatewayId = normalizeAddress(id); + this._orderGatewayId = this.encoder.normalizeAddress(id); } /** @@ -232,7 +243,7 @@ export class GenericProvider extends EventEmitter implements ProviderBase { method: 'eth_accounts', params: [], }); - return res.result.map((a) => normalizeAddress(a)); + return res.result.map((a) => this.encoder.normalizeAddress(a)); } /** @@ -250,14 +261,14 @@ export class GenericProvider extends EventEmitter implements ProviderBase { * Returns true if the provided accountId maches current class accountId. */ public isCurrentAccount(accountId: string) { - return this.accountId === normalizeAddress(accountId); + return this.accountId === this.encoder.normalizeAddress(accountId); } /** * Returns true if the provided ledgerId is unsafe recipient address. */ public isUnsafeRecipientId(ledgerId: string) { - const normalizedLedgerId = normalizeAddress(ledgerId); + const normalizedLedgerId = this.encoder.normalizeAddress(ledgerId); return !!this.unsafeRecipientIds.find((id) => id === normalizedLedgerId); } diff --git a/packages/0xcert-ethereum-http-provider/CHANGELOG.md b/packages/0xcert-ethereum-http-provider/CHANGELOG.md index 8527470ed..bd795ec8f 100644 --- a/packages/0xcert-ethereum-http-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-http-provider/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-http-provider/src/core/provider.ts b/packages/0xcert-ethereum-http-provider/src/core/provider.ts index a6cb23604..179705d7a 100644 --- a/packages/0xcert-ethereum-http-provider/src/core/provider.ts +++ b/packages/0xcert-ethereum-http-provider/src/core/provider.ts @@ -92,7 +92,7 @@ export class HttpProvider extends GenericProvider { * @param options HTTP provider options. */ public static getInstance(options: HttpProviderOptions): HttpProvider { - return new HttpProvider(options); + return new this(options); } /** diff --git a/packages/0xcert-ethereum-http-provider/src/tests/index.test.ts b/packages/0xcert-ethereum-http-provider/src/tests/index.test.ts index 4042840af..c1c88c144 100644 --- a/packages/0xcert-ethereum-http-provider/src/tests/index.test.ts +++ b/packages/0xcert-ethereum-http-provider/src/tests/index.test.ts @@ -5,6 +5,8 @@ const spec = new Spec(); spec.test('exposes objects', (ctx) => { ctx.true(!!view.HttpProvider); + ctx.true(!!view.SignMethod); + ctx.true(!!view.Mutation); }); export default spec; diff --git a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md index 4bc65ba88..7d24bddcd 100644 --- a/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md +++ b/packages/0xcert-ethereum-metamask-provider/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-metamask-provider/src/core/provider.ts b/packages/0xcert-ethereum-metamask-provider/src/core/provider.ts index bb3ea22af..0f57745bd 100644 --- a/packages/0xcert-ethereum-metamask-provider/src/core/provider.ts +++ b/packages/0xcert-ethereum-metamask-provider/src/core/provider.ts @@ -55,7 +55,7 @@ export class MetamaskProvider extends GenericProvider { * Gets an instance of metamask provider. */ public static getInstance(): MetamaskProvider { - return new MetamaskProvider(); + return new this(); } /** diff --git a/packages/0xcert-ethereum-metamask-provider/src/tests/index.test.ts b/packages/0xcert-ethereum-metamask-provider/src/tests/index.test.ts index 3a6241a58..c2d149685 100644 --- a/packages/0xcert-ethereum-metamask-provider/src/tests/index.test.ts +++ b/packages/0xcert-ethereum-metamask-provider/src/tests/index.test.ts @@ -5,6 +5,8 @@ const spec = new Spec(); spec.test('exposes objects', (ctx) => { ctx.true(!!view.MetamaskProvider); + ctx.true(!!view.SignMethod); + ctx.true(!!view.Mutation); }); export default spec; diff --git a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md index a5f9d952e..8b671c138 100644 --- a/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway-contracts/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md index 82f7f8584..ad731c6b9 100644 --- a/packages/0xcert-ethereum-order-gateway/CHANGELOG.md +++ b/packages/0xcert-ethereum-order-gateway/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts index 66e300651..60373c6a1 100644 --- a/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts +++ b/packages/0xcert-ethereum-order-gateway/src/core/gateway.ts @@ -1,5 +1,4 @@ import { GenericProvider, Mutation, SignMethod } from '@0xcert/ethereum-generic-provider'; -import { normalizeAddress } from '@0xcert/ethereum-utils'; import { Order, OrderGatewayBase } from '@0xcert/scaffold'; import { normalizeOrderIds } from '../lib/order'; import cancel from '../mutations/cancel'; @@ -32,7 +31,7 @@ export class OrderGateway implements OrderGatewayBase { * @param id Address of the order gateway smart contract. */ public static getInstance(provider: GenericProvider, id?: string): OrderGateway { - return new OrderGateway(provider, id); + return new this(provider, id); } /** @@ -41,8 +40,8 @@ export class OrderGateway implements OrderGatewayBase { * @param id Address of the order gateway smart contract. */ public constructor(provider: GenericProvider, id?: string) { - this._id = normalizeAddress(id || provider.orderGatewayId); this._provider = provider; + this._id = this._provider.encoder.normalizeAddress(id || provider.orderGatewayId); } /** @@ -64,7 +63,7 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async claim(order: Order): Promise { - order = normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); if (this._provider.signMethod == SignMethod.PERSONAL_SIGN) { return claimPersonalSign(this, order); @@ -79,7 +78,7 @@ export class OrderGateway implements OrderGatewayBase { * @param claim Claim data. */ public async perform(order: Order, claim: string): Promise { - order = normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); return perform(this, order, claim); } @@ -89,7 +88,7 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async cancel(order: Order): Promise { - order = normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); return cancel(this, order); } @@ -108,7 +107,7 @@ export class OrderGateway implements OrderGatewayBase { * @param claim Claim data. */ public async isValidSignature(order: Order, claim: string) { - order = normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); return isValidSignature(this, order, claim); } @@ -118,7 +117,7 @@ export class OrderGateway implements OrderGatewayBase { * @param order Order data. */ public async getOrderDataClaim(order: Order) { - order = normalizeOrderIds(order); + order = normalizeOrderIds(order, this._provider); return getOrderDataClaim(this, order); } diff --git a/packages/0xcert-ethereum-order-gateway/src/lib/order.ts b/packages/0xcert-ethereum-order-gateway/src/lib/order.ts index 3a5acf88a..67c3da152 100644 --- a/packages/0xcert-ethereum-order-gateway/src/lib/order.ts +++ b/packages/0xcert-ethereum-order-gateway/src/lib/order.ts @@ -1,5 +1,5 @@ -import { SignMethod } from '@0xcert/ethereum-generic-provider'; -import { bigNumberify, normalizeAddress } from '@0xcert/ethereum-utils'; +import { GenericProvider, SignMethod } from '@0xcert/ethereum-generic-provider'; +import { bigNumberify } from '@0xcert/ethereum-utils'; import { Order, OrderAction, OrderActionKind } from '@0xcert/scaffold'; import { keccak256, toInteger, toSeconds, toTuple } from '@0xcert/utils'; import { OrderGateway } from '../core/gateway'; @@ -186,14 +186,14 @@ export function leftPad(input: any, chars: number, sign?: string, prefix?: boole * Normalizes order IDs and returns a new order object. * @param order Order instance. */ -export function normalizeOrderIds(order: Order): Order { +export function normalizeOrderIds(order: Order, provider: GenericProvider): Order { order = JSON.parse(JSON.stringify(order)); - order.makerId = normalizeAddress(order.makerId); - order.takerId = normalizeAddress(order.takerId); + order.makerId = provider.encoder.normalizeAddress(order.makerId); + order.takerId = provider.encoder.normalizeAddress(order.takerId); order.actions.forEach((action) => { - action.ledgerId = normalizeAddress(action.ledgerId); - action.receiverId = normalizeAddress(action.receiverId); - action.senderId = normalizeAddress(action.senderId); + action.ledgerId = provider.encoder.normalizeAddress(action.ledgerId); + action.receiverId = provider.encoder.normalizeAddress(action.receiverId); + action.senderId = provider.encoder.normalizeAddress(action.senderId); }); return order; } diff --git a/packages/0xcert-ethereum-order-gateway/src/mutations/cancel.ts b/packages/0xcert-ethereum-order-gateway/src/mutations/cancel.ts index 893234808..6e5f90222 100644 --- a/packages/0xcert-ethereum-order-gateway/src/mutations/cancel.ts +++ b/packages/0xcert-ethereum-order-gateway/src/mutations/cancel.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { Order } from '../../../0xcert-scaffold/dist'; import { OrderGateway } from '../core/gateway'; import { createRecipeTuple } from '../lib/order'; @@ -17,7 +16,7 @@ export default async function(gateway: OrderGateway, order: Order) { const attrs = { from: gateway.provider.accountId, to: gateway.id, - data: functionSignature + encodeParameters(inputTypes, [recipeTuple]).substr(2), + data: functionSignature + gateway.provider.encoder.encodeParameters(inputTypes, [recipeTuple]).substr(2), }; const res = await gateway.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-order-gateway/src/mutations/perform.ts b/packages/0xcert-ethereum-order-gateway/src/mutations/perform.ts index 600fce82d..eaf937ab6 100644 --- a/packages/0xcert-ethereum-order-gateway/src/mutations/perform.ts +++ b/packages/0xcert-ethereum-order-gateway/src/mutations/perform.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { Order } from '../../../0xcert-scaffold/dist'; import { OrderGateway } from '../core/gateway'; import { createRecipeTuple, createSignatureTuple } from '../lib/order'; @@ -19,7 +18,7 @@ export default async function(gateway: OrderGateway, order: Order, claim: string const attrs = { from: gateway.provider.accountId, to: gateway.id, - data: functionSignature + encodeParameters(inputTypes, [recipeTuple, signatureTuple]).substr(2), + data: functionSignature + gateway.provider.encoder.encodeParameters(inputTypes, [recipeTuple, signatureTuple]).substr(2), }; const res = await gateway.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-order-gateway/src/queries/get-order-data-claim.ts b/packages/0xcert-ethereum-order-gateway/src/queries/get-order-data-claim.ts index 74333a7f6..60e87cd31 100644 --- a/packages/0xcert-ethereum-order-gateway/src/queries/get-order-data-claim.ts +++ b/packages/0xcert-ethereum-order-gateway/src/queries/get-order-data-claim.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { Order } from '@0xcert/scaffold'; import { OrderGateway } from '../core/gateway'; import { createRecipeTuple } from '../lib/order'; @@ -17,13 +16,13 @@ export default async function(gateway: OrderGateway, order: Order) { try { const attrs = { to: gateway.id, - data: functionSignature + encodeParameters(inputTypes, [recipeTuple]).substr(2), + data: functionSignature + gateway.provider.encoder.encodeParameters(inputTypes, [recipeTuple]).substr(2), }; const res = await gateway.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return gateway.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-order-gateway/src/queries/get-proxy-account-id.ts b/packages/0xcert-ethereum-order-gateway/src/queries/get-proxy-account-id.ts index 6e299c381..69f83295c 100644 --- a/packages/0xcert-ethereum-order-gateway/src/queries/get-proxy-account-id.ts +++ b/packages/0xcert-ethereum-order-gateway/src/queries/get-proxy-account-id.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { OrderGateway } from '../core/gateway'; import { OrderGatewayProxy } from '../core/types'; @@ -15,13 +14,13 @@ export default async function(gateway: OrderGateway, proxyId: OrderGatewayProxy) try { const attrs = { to: gateway.id, - data: functionSignature + encodeParameters(inputTypes, [proxyId]).substr(2), + data: functionSignature + gateway.provider.encoder.encodeParameters(inputTypes, [proxyId]).substr(2), }; const res = await gateway.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return gateway.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-order-gateway/src/queries/is-valid-signature.ts b/packages/0xcert-ethereum-order-gateway/src/queries/is-valid-signature.ts index cf7bf098c..25be473df 100644 --- a/packages/0xcert-ethereum-order-gateway/src/queries/is-valid-signature.ts +++ b/packages/0xcert-ethereum-order-gateway/src/queries/is-valid-signature.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { Order } from '@0xcert/scaffold'; import { OrderGateway } from '../core/gateway'; import { createOrderHash, createSignatureTuple } from '../lib/order'; @@ -19,13 +18,13 @@ export default async function(gateway: OrderGateway, order: Order, claim: string try { const attrs = { to: gateway.id, - data: functionSignature + encodeParameters(inputTypes, [order.makerId, orderHash, signatureTuple]).substr(2), + data: functionSignature + gateway.provider.encoder.encodeParameters(inputTypes, [order.makerId, orderHash, signatureTuple]).substr(2), }; const res = await gateway.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0]; + return gateway.provider.encoder.decodeParameters(outputTypes, res.result)[0]; } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-order-gateway/src/tests/index.test.ts b/packages/0xcert-ethereum-order-gateway/src/tests/index.test.ts index 591d76fd3..4e992e5b2 100644 --- a/packages/0xcert-ethereum-order-gateway/src/tests/index.test.ts +++ b/packages/0xcert-ethereum-order-gateway/src/tests/index.test.ts @@ -5,6 +5,7 @@ const spec = new Spec(); spec.test('exposes objects', (ctx) => { ctx.true(!!exchange.OrderGateway); + ctx.true(!!exchange.Order); }); export default spec; diff --git a/packages/0xcert-ethereum-order-gateway/src/tests/lib/order/normalize-order-ids-method.test.ts b/packages/0xcert-ethereum-order-gateway/src/tests/lib/order/normalize-order-ids-method.test.ts index 1965b1428..947407036 100644 --- a/packages/0xcert-ethereum-order-gateway/src/tests/lib/order/normalize-order-ids-method.test.ts +++ b/packages/0xcert-ethereum-order-gateway/src/tests/lib/order/normalize-order-ids-method.test.ts @@ -1,3 +1,4 @@ +import { GenericProvider } from '@0xcert/ethereum-generic-provider'; import { OrderActionKind } from '@0xcert/scaffold'; import { Spec } from '@specron/spec'; import { normalizeOrderIds } from '../../../lib/order'; @@ -19,7 +20,7 @@ spec.test('converts addresses to checksum addresses', async (ctx) => { assetId: '100', }, ], - }), { + }, new GenericProvider({})), { makerId: '0x44e44897FC076Bc46AaE6b06b917D0dfD8B2dae9', takerId: '0x44e44897FC076Bc46AaE6b06b917D0dfD8B2dae9', seed: 100, diff --git a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md index 93bab705a..8a40b3441 100644 --- a/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-proxy-contracts/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-sandbox/CHANGELOG.md b/packages/0xcert-ethereum-sandbox/CHANGELOG.md index 443322d14..2836d7319 100644 --- a/packages/0xcert-ethereum-sandbox/CHANGELOG.md +++ b/packages/0xcert-ethereum-sandbox/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md index 398c95b8d..55d89bc50 100644 --- a/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-utils-contracts/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-ethereum-utils/src/index.ts b/packages/0xcert-ethereum-utils/src/index.ts index 7572a5bcc..ae0e6c546 100644 --- a/packages/0xcert-ethereum-utils/src/index.ts +++ b/packages/0xcert-ethereum-utils/src/index.ts @@ -1,3 +1,5 @@ export * from './lib/abi'; export * from './lib/normalize-address'; export * from './lib/big-number'; +export * from './lib/encoder'; +export * from './types/utils'; diff --git a/packages/0xcert-ethereum-utils/src/lib/encoder.ts b/packages/0xcert-ethereum-utils/src/lib/encoder.ts new file mode 100644 index 000000000..60537f808 --- /dev/null +++ b/packages/0xcert-ethereum-utils/src/lib/encoder.ts @@ -0,0 +1,35 @@ +import { AbiCoder } from 'ethers/utils/abi-coder'; +import { getAddress } from 'ethers/utils/address'; +import { Encode } from '../types/utils'; + +export class Encoder implements Encode { + + private coder: AbiCoder = new AbiCoder(); + + /** + * Encodes parameters for smart contract call. + * @param types Input types. + * @param values Input values. + */ + public encodeParameters(types: any, values: Array): string { + return this.coder.encode(types, values); + } + + /** + * Decodes parameters from smart contract return. + * @param types Output types. + * @param data Output data. + */ + public decodeParameters(types: any, data: any): any { + return this.coder.decode(types, data); + } + + /** + * Converts ethereum address to checksum format. + * @see https://github.com/ethereum/EIPs/blob/master/EIPS/eip-55.md + */ + public normalizeAddress(address: string): string { + return address ? getAddress(address) : null; + } + +} diff --git a/packages/0xcert-ethereum-utils/src/types/utils.ts b/packages/0xcert-ethereum-utils/src/types/utils.ts new file mode 100644 index 000000000..a5a56a0d4 --- /dev/null +++ b/packages/0xcert-ethereum-utils/src/types/utils.ts @@ -0,0 +1,22 @@ +export interface Encode { + + /** + * Converts address to checksum format. + * @param address Address to covert. + */ + normalizeAddress(address: string): string; + + /** + * Encodes parameters for smart contract call. + * @param types Input types. + * @param values Input values. + */ + encodeParameters(types: any, values: Array): string; + + /** + * Decodes parameters from smart contract return. + * @param types Output types. + * @param data Output data. + */ + decodeParameters(types: any, data: any): any; +} diff --git a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md index 5be9aacb1..677f6ceaf 100644 --- a/packages/0xcert-ethereum-value-ledger/CHANGELOG.md +++ b/packages/0xcert-ethereum-value-ledger/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts index 0d6d78467..5e9a713c9 100644 --- a/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts +++ b/packages/0xcert-ethereum-value-ledger/src/core/ledger.ts @@ -1,5 +1,5 @@ import { GenericProvider, Mutation } from '@0xcert/ethereum-generic-provider'; -import { bigNumberify, normalizeAddress } from '@0xcert/ethereum-utils'; +import { bigNumberify } from '@0xcert/ethereum-utils'; import { OrderGatewayBase, ProviderError, ProviderIssue, ValueLedgerBase, ValueLedgerDeployRecipe, ValueLedgerInfo, ValueLedgerTransferRecipe } from '@0xcert/scaffold'; import approveAccount from '../mutations/approve-account'; @@ -40,7 +40,7 @@ export class ValueLedger implements ValueLedgerBase { * @param id Address of the erc20 smart contract. */ public static getInstance(provider: GenericProvider, id: string): ValueLedger { - return new ValueLedger(provider, id); + return new this(provider, id); } /** @@ -49,8 +49,8 @@ export class ValueLedger implements ValueLedgerBase { * @param id Address of the erc20 smart contract. */ public constructor(provider: GenericProvider, id: string) { - this._id = normalizeAddress(id); this._provider = provider; + this._id = this._provider.encoder.normalizeAddress(id); } /** @@ -77,8 +77,8 @@ export class ValueLedger implements ValueLedgerBase { spenderId = await (spenderId as any).getProxyAccountId(1); } - accountId = normalizeAddress(accountId); - spenderId = normalizeAddress(spenderId as string); + accountId = this._provider.encoder.normalizeAddress(accountId); + spenderId = this._provider.encoder.normalizeAddress(spenderId as string); return getAllowance(this, accountId, spenderId); } @@ -88,7 +88,7 @@ export class ValueLedger implements ValueLedgerBase { * @param accountId Account id. */ public async getBalance(accountId: string): Promise { - accountId = normalizeAddress(accountId); + accountId = this._provider.encoder.normalizeAddress(accountId); return getBalance(this, accountId); } @@ -111,8 +111,8 @@ export class ValueLedger implements ValueLedgerBase { spenderId = await (spenderId as any).getProxyAccountId(1); } - accountId = normalizeAddress(accountId); - spenderId = normalizeAddress(spenderId as string); + accountId = this._provider.encoder.normalizeAddress(accountId); + spenderId = this._provider.encoder.normalizeAddress(spenderId as string); const approved = await getAllowance(this, accountId, spenderId); return bigNumberify(approved).gte(bigNumberify(value)); @@ -128,7 +128,7 @@ export class ValueLedger implements ValueLedgerBase { accountId = await (accountId as any).getProxyAccountId(1); } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); const approvedValue = await this.getApprovedValue(this.provider.accountId, accountId); if (!bigNumberify(value).isZero() && !bigNumberify(approvedValue).isZero()) { @@ -147,7 +147,7 @@ export class ValueLedger implements ValueLedgerBase { accountId = await (accountId as any).getProxyAccountId(1); } - accountId = normalizeAddress(accountId as string); + accountId = this._provider.encoder.normalizeAddress(accountId as string); return approveAccount(this, accountId, '0'); } @@ -157,8 +157,8 @@ export class ValueLedger implements ValueLedgerBase { * @param recipe Data needed for the transfer. */ public async transferValue(recipe: ValueLedgerTransferRecipe): Promise { - const senderId = normalizeAddress(recipe.senderId); - const receiverId = normalizeAddress(recipe.receiverId); + const senderId = this._provider.encoder.normalizeAddress(recipe.senderId); + const receiverId = this._provider.encoder.normalizeAddress(recipe.receiverId); return recipe.senderId ? transferFrom(this, senderId, receiverId, recipe.value) diff --git a/packages/0xcert-ethereum-value-ledger/src/index.ts b/packages/0xcert-ethereum-value-ledger/src/index.ts index eb31746b1..cb5d078c7 100644 --- a/packages/0xcert-ethereum-value-ledger/src/index.ts +++ b/packages/0xcert-ethereum-value-ledger/src/index.ts @@ -1 +1,2 @@ +export { ValueLedgerDeployRecipe, ValueLedgerInfo, ValueLedgerTransferRecipe } from '@0xcert/scaffold'; export * from './core/ledger'; diff --git a/packages/0xcert-ethereum-value-ledger/src/mutations/approve-account.ts b/packages/0xcert-ethereum-value-ledger/src/mutations/approve-account.ts index 40c6e517e..177d174d5 100644 --- a/packages/0xcert-ethereum-value-ledger/src/mutations/approve-account.ts +++ b/packages/0xcert-ethereum-value-ledger/src/mutations/approve-account.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedger } from '../core/ledger'; const functionSignature = '0x095ea7b3'; @@ -15,7 +14,7 @@ export default async function(ledger: ValueLedger, accountId: string, value: str const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, value]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, value]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-value-ledger/src/mutations/deploy.ts b/packages/0xcert-ethereum-value-ledger/src/mutations/deploy.ts index 57f98e746..9da931ac2 100644 --- a/packages/0xcert-ethereum-value-ledger/src/mutations/deploy.ts +++ b/packages/0xcert-ethereum-value-ledger/src/mutations/deploy.ts @@ -1,5 +1,4 @@ import { GenericProvider, Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedgerDeployRecipe } from '@0xcert/scaffold'; import { fetch } from '@0xcert/utils'; @@ -15,7 +14,7 @@ export default async function(provider: GenericProvider, { name, symbol, decimal const source = contract.TokenMock.evm.bytecode.object; const attrs = { from: provider.accountId, - data: `0x${source}${encodeParameters(inputTypes, [ name, symbol, decimals, supply]).substr(2)}`, + data: `0x${source}${provider.encoder.encodeParameters(inputTypes, [ name, symbol, decimals, supply]).substr(2)}`, }; const res = await provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-value-ledger/src/mutations/transfer-from.ts b/packages/0xcert-ethereum-value-ledger/src/mutations/transfer-from.ts index 3b6706ee8..7f971d661 100644 --- a/packages/0xcert-ethereum-value-ledger/src/mutations/transfer-from.ts +++ b/packages/0xcert-ethereum-value-ledger/src/mutations/transfer-from.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedger } from '../core/ledger'; const functionSignature = '0x23b872dd'; @@ -16,7 +15,7 @@ export default async function(ledger: ValueLedger, senderId: string, receiverId: const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [senderId, receiverId, value]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [senderId, receiverId, value]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-value-ledger/src/mutations/transfer.ts b/packages/0xcert-ethereum-value-ledger/src/mutations/transfer.ts index 3796b0acc..c978d2e77 100644 --- a/packages/0xcert-ethereum-value-ledger/src/mutations/transfer.ts +++ b/packages/0xcert-ethereum-value-ledger/src/mutations/transfer.ts @@ -1,5 +1,4 @@ import { Mutation } from '@0xcert/ethereum-generic-provider'; -import { encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedger } from '../core/ledger'; const functionSignature = '0xa9059cbb'; @@ -15,7 +14,7 @@ export default async function(ledger: ValueLedger, receiverId: string, value: st const attrs = { from: ledger.provider.accountId, to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [receiverId, value]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [receiverId, value]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_sendTransaction', diff --git a/packages/0xcert-ethereum-value-ledger/src/queries/get-allowance.ts b/packages/0xcert-ethereum-value-ledger/src/queries/get-allowance.ts index e92cd9661..beb672411 100644 --- a/packages/0xcert-ethereum-value-ledger/src/queries/get-allowance.ts +++ b/packages/0xcert-ethereum-value-ledger/src/queries/get-allowance.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedger } from '../core/ledger'; const functionSignature = '0xdd62ed3e'; @@ -15,13 +14,13 @@ export default async function(ledger: ValueLedger, accountId: string, spenderId: try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId, spenderId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId, spenderId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0].toString(); + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0].toString(); } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-value-ledger/src/queries/get-balance.ts b/packages/0xcert-ethereum-value-ledger/src/queries/get-balance.ts index aef20becf..7115eb234 100644 --- a/packages/0xcert-ethereum-value-ledger/src/queries/get-balance.ts +++ b/packages/0xcert-ethereum-value-ledger/src/queries/get-balance.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedger } from '../core/ledger'; const functionSignature = '0x70a08231'; @@ -14,13 +13,13 @@ export default async function(ledger: ValueLedger, accountId: string) { try { const attrs = { to: ledger.id, - data: functionSignature + encodeParameters(inputTypes, [accountId]).substr(2), + data: functionSignature + ledger.provider.encoder.encodeParameters(inputTypes, [accountId]).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(outputTypes, res.result)[0].toString(); + return ledger.provider.encoder.decodeParameters(outputTypes, res.result)[0].toString(); } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-value-ledger/src/queries/get-info.ts b/packages/0xcert-ethereum-value-ledger/src/queries/get-info.ts index 9d9d33716..485e24cad 100644 --- a/packages/0xcert-ethereum-value-ledger/src/queries/get-info.ts +++ b/packages/0xcert-ethereum-value-ledger/src/queries/get-info.ts @@ -1,4 +1,3 @@ -import { decodeParameters, encodeParameters } from '@0xcert/ethereum-utils'; import { ValueLedger } from '../core/ledger'; const functions = [ @@ -34,13 +33,13 @@ export default async function(ledger: ValueLedger) { try { const attrs = { to: ledger.id, - data: f.signature + encodeParameters(f.inputTypes, []).substr(2), + data: f.signature + ledger.provider.encoder.encodeParameters(f.inputTypes, []).substr(2), }; const res = await ledger.provider.post({ method: 'eth_call', params: [attrs, 'latest'], }); - return decodeParameters(f.outputTypes, res.result)[0].toString(); + return ledger.provider.encoder.decodeParameters(f.outputTypes, res.result)[0].toString(); } catch (error) { return null; } diff --git a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md index 220a54cec..668f6b411 100644 --- a/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md +++ b/packages/0xcert-ethereum-xcert-contracts/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-merkle/CHANGELOG.md b/packages/0xcert-merkle/CHANGELOG.md index 1fa1b2a08..7f6574443 100644 --- a/packages/0xcert-merkle/CHANGELOG.md +++ b/packages/0xcert-merkle/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-scaffold/CHANGELOG.md b/packages/0xcert-scaffold/CHANGELOG.md index 1cbb6a9de..3073fe804 100644 --- a/packages/0xcert-scaffold/CHANGELOG.md +++ b/packages/0xcert-scaffold/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-utils/CHANGELOG.md b/packages/0xcert-utils/CHANGELOG.md index d88f13211..ff7639c9d 100644 --- a/packages/0xcert-utils/CHANGELOG.md +++ b/packages/0xcert-utils/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Version update only* diff --git a/packages/0xcert-vue-plugin/CHANGELOG.md b/packages/0xcert-vue-plugin/CHANGELOG.md index ad3a65d16..558427478 100644 --- a/packages/0xcert-vue-plugin/CHANGELOG.md +++ b/packages/0xcert-vue-plugin/CHANGELOG.md @@ -22,7 +22,7 @@ Tue, 23 Apr 2019 13:16:49 GMT *Version update only* -## 1.0.1 +## 1.2.0 Fri, 22 Mar 2019 09:48:00 GMT *Initial release* diff --git a/packages/0xcert-wanchain-asset-ledger/README.md b/packages/0xcert-wanchain-asset-ledger/README.md new file mode 100644 index 000000000..a19f11ba9 --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/README.md @@ -0,0 +1,7 @@ + + +> Asset ledger module for asset management on the Wanchain blockchain. + +The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details. + +This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues). diff --git a/packages/0xcert-wanchain-asset-ledger/nodemon.json b/packages/0xcert-wanchain-asset-ledger/nodemon.json new file mode 100644 index 000000000..82b893373 --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/nodemon.json @@ -0,0 +1,4 @@ +{ + "ignore": ["dist/*"], + "ext": "js,ts" +} diff --git a/packages/0xcert-wanchain-asset-ledger/package.json b/packages/0xcert-wanchain-asset-ledger/package.json new file mode 100644 index 000000000..ec77c7e31 --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/package.json @@ -0,0 +1,78 @@ +{ + "name": "@0xcert/wanchain-asset-ledger", + "version": "1.2.0", + "description": "Asset ledger module for asset management on the Wanchain blockchain.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "npm run clean && npx tsc", + "clean": "rm -Rf ./dist", + "lint": "npx tslint 'src/**/*.ts?(x)'", + "test": "npm run lint && npx nyc npx hayspec test" + }, + "hayspec": { + "require": [ + "ts-node/register" + ], + "match": [ + "./src/tests/**/*.test.ts" + ] + }, + "nyc": { + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "exclude": [ + "src/tests" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/0xcert/framework.git" + }, + "bugs": { + "url": "https://github.com/0xcert/framework/issues" + }, + "homepage": "https://github.com/0xcert/framework#readme", + "keywords": [ + "0xcert", + "framework", + "protocol", + "asset", + "value", + "values", + "currency", + "token", + "non-fungible", + "fungible", + "erc-721", + "erc-20", + "blockchain", + "javascript", + "typescript", + "nodejs", + "vuejs", + "nuxtjs", + "npm", + "libraries", + "smart-contract", + "wanchain", + "zxc" + ], + "license": "MIT", + "devDependencies": { + "@0xcert/ethereum-generic-provider": "1.2.0", + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + }, + "dependencies": { + "@0xcert/ethereum-asset-ledger": "1.2.0" + } +} diff --git a/packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts b/packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts new file mode 100644 index 000000000..8ece5f08b --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/src/core/ledger.ts @@ -0,0 +1,6 @@ +import * as ethereum from '@0xcert/ethereum-asset-ledger'; + +/** + * Wanchain asset ledger implementation. + */ +export class AssetLedger extends ethereum.AssetLedger { } diff --git a/packages/0xcert-wanchain-asset-ledger/src/index.ts b/packages/0xcert-wanchain-asset-ledger/src/index.ts new file mode 100644 index 000000000..297636d7c --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/src/index.ts @@ -0,0 +1,5 @@ +export { AssetLedgerBase, AssetLedgerDeployRecipe, AssetLedgerAbility, GeneralAssetLedgerAbility, + SuperAssetLedgerAbility, AssetLedgerItem, AssetLedgerCapability, AssetLedgerInfo, + AssetLedgerItemRecipe, AssetLedgerTransferRecipe, AssetLedgerObjectUpdateRecipe, + AssetLedgerUpdateRecipe } from '@0xcert/ethereum-asset-ledger'; +export * from './core/ledger'; diff --git a/packages/0xcert-wanchain-asset-ledger/src/tests/index.test.ts b/packages/0xcert-wanchain-asset-ledger/src/tests/index.test.ts new file mode 100644 index 000000000..76c1b78bc --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/src/tests/index.test.ts @@ -0,0 +1,13 @@ +import { Spec } from '@hayspec/spec'; +import * as ledger from '..'; + +const spec = new Spec(); + +spec.test('exposes objects', (ctx) => { + ctx.true(!!ledger.AssetLedger); + ctx.true(!!ledger.GeneralAssetLedgerAbility); + ctx.true(!!ledger.SuperAssetLedgerAbility); + ctx.true(!!ledger.AssetLedgerCapability); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-asset-ledger/tsconfig.json b/packages/0xcert-wanchain-asset-ledger/tsconfig.json new file mode 100644 index 000000000..4aeac3c20 --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "removeComments": true, + "sourceMap": true, + "outDir": "dist", + "declaration": true, + "experimentalDecorators": true + } +} \ No newline at end of file diff --git a/packages/0xcert-wanchain-asset-ledger/tslint.json b/packages/0xcert-wanchain-asset-ledger/tslint.json new file mode 100644 index 000000000..c57b3f0cd --- /dev/null +++ b/packages/0xcert-wanchain-asset-ledger/tslint.json @@ -0,0 +1,253 @@ +{ + "rules": { + "no-unnecessary-class": [ + true, + "allow-constructor-only", + "allow-static-only", + "allow-empty-class" + ], + "member-access": [ + true, + "check-accessor", + "check-constructor" + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "adjacent-overload-signatures": true, + "prefer-function-over-method": [ + true, + "allow-public", + "allow-protected" + ], + "no-invalid-this": [ + true, + "check-function-in-method" + ], + "no-this-assignment": true, + "unnecessary-constructor": true, + "no-duplicate-super": true, + "new-parens": true, + "no-misused-new": true, + "no-construct": true, + "prefer-method-signature": true, + "interface-over-type-literal": true, + "function-constructor": true, + "no-arg": true, + "arrow-parens": [ + true + ], + "arrow-return-shorthand": [ + false, + "multiline" + ], + "unnecessary-bind": true, + "no-return-await": true, + "prefer-const": true, + "no-var-keyword": true, + "one-variable-per-declaration": [ + true, + "ignore-for-loop" + ], + "no-duplicate-variable": [ + true, + "check-parameters" + ], + "no-unnecessary-initializer": true, + "no-implicit-dependencies": [ + true, + "dev" + ], + "no-import-side-effect": [ + true, + { + "ignore-module": "(hammerjs|core-js|zone.js)" + } + ], + "ordered-imports": [ + true, + { + "import-sources-order": "case-insensitive", + "named-imports-order": "case-insensitive", + "grouped-imports": false + } + ], + "no-duplicate-imports": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "no-reference": true, + "typedef": [ + true, + "property-declaration" + ], + "no-inferrable-types": true, + "no-object-literal-type-assertion": true, + "no-angle-bracket-type-assertion": true, + "callable-types": true, + "no-non-null-assertion": true, + "prefer-object-spread": true, + "object-literal-shorthand": true, + "quotemark": [ + true, + "single", + "avoid-template", + "avoid-escape" + ], + "prefer-template": true, + "no-invalid-template-strings": true, + "increment-decrement": [ + true, + "allow-post" + ], + "binary-expression-operand-order": true, + "no-dynamic-delete": true, + "no-bitwise": true, + "use-isnan": true, + "no-conditional-assignment": true, + "prefer-conditional-expression": [ + true, + "check-else-if" + ], + "prefer-while": true, + "prefer-for-of": true, + "forin": true, + "switch-default": true, + "no-switch-case-fall-through": true, + "no-duplicate-switch-case": true, + "no-unsafe-finally": true, + "encoding": true, + "cyclomatic-complexity": [ + true, + 20 + ], + "indent": [ + true, + "spaces", + 2 + ], + "eofline": true, + "curly": true, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-type-operator", + "check-preblock" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "space-before-function-paren": [ + true, + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always", + "method": "never", + "constructor": "never" + } + ], + "space-within-parens": 0, + "import-spacing": true, + "no-trailing-whitespace": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace", + "check-else", + "check-catch", + "check-finally" + ], + "no-consecutive-blank-lines": [ + true, + 1 + ], + "semicolon": [ + true, + "always", + "strict-bound-class-methods" + ], + "align": [ + true, + "elements", + "members", + "parameters", + "statements" + ], + "trailing-comma": [ + true, + { + "multiline": "always", + "esSpecCompliant": true + } + ], + "file-name-casing": [ + true, + "kebab-case" + ], + "class-name": true, + "interface-name": [ + true, + "never-prefix" + ], + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "comment-type": [ + true, + "singleline", + "doc" + ], + "comment-format": [ + true, + "check-space" + ], + "jsdoc-format": [ + true, + "check-multiline-start" + ], + "no-redundant-jsdoc": true, + "ban-ts-ignore": true, + "no-debugger": true, + "no-eval": true, + "no-string-throw": true, + "no-namespace": true, + "no-internal-module": true, + "number-literal-format": true, + "no-unused-expression": [ + true, + "allow-fast-null-checks" + ], + "no-empty": true, + "no-sparse-arrays": true, + "ban-comma-operator": true + } +} diff --git a/packages/0xcert-wanchain-http-provider/README.md b/packages/0xcert-wanchain-http-provider/README.md new file mode 100644 index 000000000..1f22e4c41 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/README.md @@ -0,0 +1,7 @@ + + +> Implementation of HTTP communication provider for the Wanchain blockchain. + +The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details. + +This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues). diff --git a/packages/0xcert-wanchain-http-provider/nodemon.json b/packages/0xcert-wanchain-http-provider/nodemon.json new file mode 100644 index 000000000..82b893373 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/nodemon.json @@ -0,0 +1,4 @@ +{ + "ignore": ["dist/*"], + "ext": "js,ts" +} diff --git a/packages/0xcert-wanchain-http-provider/package.json b/packages/0xcert-wanchain-http-provider/package.json new file mode 100644 index 000000000..14986e488 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/package.json @@ -0,0 +1,79 @@ +{ + "name": "@0xcert/wanchain-http-provider", + "version": "1.2.0", + "description": "Implementation of HTTP communication provider for the Wanchain blockchain.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "npm run clean && npx tsc", + "clean": "rm -Rf ./dist", + "lint": "npx tslint 'src/**/*.ts?(x)'", + "test": "npm run lint && npx nyc npx hayspec test" + }, + "hayspec": { + "require": [ + "ts-node/register" + ], + "match": [ + "./src/tests/**/*.test.ts" + ] + }, + "nyc": { + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "exclude": [ + "src/tests" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/0xcert/framework.git" + }, + "bugs": { + "url": "https://github.com/0xcert/framework/issues" + }, + "homepage": "https://github.com/0xcert/framework#readme", + "keywords": [ + "0xcert", + "framework", + "protocol", + "asset", + "value", + "values", + "currency", + "token", + "non-fungible", + "fungible", + "erc-721", + "erc-20", + "blockchain", + "javascript", + "typescript", + "nodejs", + "vuejs", + "nuxtjs", + "npm", + "libraries", + "smart-contract", + "wanchain", + "zxc" + ], + "license": "MIT", + "devDependencies": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + }, + "dependencies": { + "@0xcert/ethereum-generic-provider": "1.2.0", + "@0xcert/wanchain-utils": "1.2.0", + "@0xcert/utils": "1.2.0" + } +} diff --git a/packages/0xcert-wanchain-http-provider/src/core/provider.ts b/packages/0xcert-wanchain-http-provider/src/core/provider.ts new file mode 100644 index 000000000..8bad29943 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/core/provider.ts @@ -0,0 +1,143 @@ +import { GenericProvider, SignMethod } from '@0xcert/ethereum-generic-provider'; +import { fetch } from '@0xcert/utils'; +import { Encoder } from '@0xcert/wanchain-utils'; + +/** + * HTTP RPC client options interface. + */ +export interface HttpProviderOptions { + + /** + * Default account from which all mutations are made. + */ + accountId?: string; + + /** + * Http call cache options. + */ + cache?: 'default' | 'no-cache' | 'reload' | 'force-cache' | 'only-if-cached' | string; + + /** + * Http call credentials. + */ + credentials?: 'include' | 'same-origin' | 'omit' | string; + + /** + * Http call headers. + */ + headers?: {[key: string]: string}; + + /** + * Http call mode. + */ + mode?: 'no-cors' | 'cors' | 'same-origin' | string; + + /** + * Http call redirect. + */ + redirect?: 'manual' | 'follow' | 'error' | string; + + /** + * Type of signature that will be used in making claims etc. + */ + signMethod?: SignMethod; + + /** + * List of addresses where normal transfer not safeTransfer smart contract methods will be used. + */ + unsafeRecipientIds?: string[]; + + /** + * Source where assetLedger compiled smart contract is located. + */ + assetLedgerSource?: string; + + /** + * Source where valueLedger compiled smart contract is located. + */ + valueLedgerSource?: string; + + /** + * Number of confirmations (blocks in blockchain after mutation is accepted) are necessary to mark a mutation complete. + */ + requiredConfirmations?: number; + + /** + * Id (address) of order gateway. + */ + orderGatewayId?: string; + + /** + * The number of milliseconds in which a mutation times out. + */ + mutationTimeout?: number; + + /** + * Url to JSON RPC endpoint. + */ + url: string; +} + +/** + * HTTP RPC client. + */ +export class HttpProvider extends GenericProvider { + + /** + * Default options set from constructor. + */ + protected _options: HttpProviderOptions; + + /** + * Returns a new provider instance. + * @param options HTTP provider options. + */ + public static getInstance(options: HttpProviderOptions): HttpProvider { + return new this(options); + } + + /** + * Class constructor. + */ + public constructor(options: HttpProviderOptions) { + super({ + encoder: new Encoder(), + ...options, + }); + + this._options = options; + this._client = this; + } + + /** + * Is provider supported. + */ + public isSupported() { + return !!this._client.fetch; + } + + /** + * Sends the RPC call. + */ + public send(data: any, callback: (err, data) => any) { + + const { url, ...options } = { + url: 'http://localhost:8545', + ...this._options, + }; + + return fetch(url, { + ...options, + method: 'POST', + body: JSON.stringify(data), + headers: { 'Content-Type': 'application/json' }, + }).then((res) => { + return res.json(); + }).then((res) => { + return callback(null, res); + }).catch((err) => { + return callback(err, null); + }); + } + +} diff --git a/packages/0xcert-wanchain-http-provider/src/index.ts b/packages/0xcert-wanchain-http-provider/src/index.ts new file mode 100644 index 000000000..8c0e5caa9 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/index.ts @@ -0,0 +1,2 @@ +export * from '@0xcert/ethereum-generic-provider'; +export * from './core/provider'; diff --git a/packages/0xcert-wanchain-http-provider/src/tests/index.test.ts b/packages/0xcert-wanchain-http-provider/src/tests/index.test.ts new file mode 100644 index 000000000..9fdbc0267 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/tests/index.test.ts @@ -0,0 +1,12 @@ +import { Spec } from '@hayspec/spec'; +import * as view from '..'; + +const spec = new Spec(); + +spec.test('exposes objects', (ctx) => { + ctx.true(!!view.HttpProvider); + ctx.true(!!view.SignMethod); + ctx.true(!!view.Mutation); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-http-provider/src/tests/provider/get-network-version-instance-method.test.ts b/packages/0xcert-wanchain-http-provider/src/tests/provider/get-network-version-instance-method.test.ts new file mode 100644 index 000000000..cd4fd74fd --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/tests/provider/get-network-version-instance-method.test.ts @@ -0,0 +1,22 @@ +import { Spec } from '@hayspec/spec'; +import { HttpProvider } from '../..'; + +const spec = new Spec<{ + provider: HttpProvider; +}>(); + +spec.before(async (stage) => { + // Blockchain connection provided by: http://infra.wanchainx.exchange/. + const provider = new HttpProvider({ + url: 'http://139.59.44.13:9000/node/5c9a341860626f3d2aad1dc0', + }); + stage.set('provider', provider); +}); + +spec.test('returns block data', async (ctx) => { + const provider = ctx.get('provider'); + const version = await provider.getNetworkVersion(); + ctx.is(version, '3'); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-http-provider/src/tests/provider/normalize-address.test.ts b/packages/0xcert-wanchain-http-provider/src/tests/provider/normalize-address.test.ts new file mode 100644 index 000000000..abee2cfb0 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/tests/provider/normalize-address.test.ts @@ -0,0 +1,22 @@ +import { Spec } from '@hayspec/spec'; +import { HttpProvider } from '../..'; + +const spec = new Spec(); + +spec.test('Check normalize address override', (ctx) => { + const provider1 = new HttpProvider({ + url: '', + accountId: '0xE96D860C8BBB30F6831E6E65D327295B7A0C524F', + }); + ctx.is(provider1.accountId, '0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'); + // ctx.is(provider1.accountId, '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + + const provider2 = new HttpProvider({ + url: '', + accountId: '0xE96D860C8BBB30F6831E6E65D327295B7A0C524F', + }); + ctx.is(provider2.accountId, '0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'); + // ctx.is(provider2.accountId, '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-http-provider/src/tests/provider/send-instance-method.test.ts b/packages/0xcert-wanchain-http-provider/src/tests/provider/send-instance-method.test.ts new file mode 100644 index 000000000..5c0fd5df5 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/src/tests/provider/send-instance-method.test.ts @@ -0,0 +1,25 @@ +import { Spec } from '@hayspec/spec'; +import { HttpProvider } from '../..'; + +const spec = new Spec<{ + provider: HttpProvider; +}>(); + +spec.before(async (stage) => { + const provider = new HttpProvider({ + url: 'http://139.59.44.13:9000/node/5c9a341860626f3d2aad1dc0', + }); + stage.set('provider', provider); +}); + +spec.test('returns block data', async (ctx) => { + const provider = ctx.get('provider'); + const tx = '0x1f5b1b974c399a1c50a6035d05fe13235cc18f09fe8162349cf5d459b7e49a43'; + const res = await provider.post({ + method: 'eth_getTransactionByHash', + params: [tx], + }); + ctx.is(res.result.hash, tx); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-http-provider/tsconfig.json b/packages/0xcert-wanchain-http-provider/tsconfig.json new file mode 100644 index 000000000..4aeac3c20 --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "removeComments": true, + "sourceMap": true, + "outDir": "dist", + "declaration": true, + "experimentalDecorators": true + } +} \ No newline at end of file diff --git a/packages/0xcert-wanchain-http-provider/tslint.json b/packages/0xcert-wanchain-http-provider/tslint.json new file mode 100644 index 000000000..c57b3f0cd --- /dev/null +++ b/packages/0xcert-wanchain-http-provider/tslint.json @@ -0,0 +1,253 @@ +{ + "rules": { + "no-unnecessary-class": [ + true, + "allow-constructor-only", + "allow-static-only", + "allow-empty-class" + ], + "member-access": [ + true, + "check-accessor", + "check-constructor" + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "adjacent-overload-signatures": true, + "prefer-function-over-method": [ + true, + "allow-public", + "allow-protected" + ], + "no-invalid-this": [ + true, + "check-function-in-method" + ], + "no-this-assignment": true, + "unnecessary-constructor": true, + "no-duplicate-super": true, + "new-parens": true, + "no-misused-new": true, + "no-construct": true, + "prefer-method-signature": true, + "interface-over-type-literal": true, + "function-constructor": true, + "no-arg": true, + "arrow-parens": [ + true + ], + "arrow-return-shorthand": [ + false, + "multiline" + ], + "unnecessary-bind": true, + "no-return-await": true, + "prefer-const": true, + "no-var-keyword": true, + "one-variable-per-declaration": [ + true, + "ignore-for-loop" + ], + "no-duplicate-variable": [ + true, + "check-parameters" + ], + "no-unnecessary-initializer": true, + "no-implicit-dependencies": [ + true, + "dev" + ], + "no-import-side-effect": [ + true, + { + "ignore-module": "(hammerjs|core-js|zone.js)" + } + ], + "ordered-imports": [ + true, + { + "import-sources-order": "case-insensitive", + "named-imports-order": "case-insensitive", + "grouped-imports": false + } + ], + "no-duplicate-imports": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "no-reference": true, + "typedef": [ + true, + "property-declaration" + ], + "no-inferrable-types": true, + "no-object-literal-type-assertion": true, + "no-angle-bracket-type-assertion": true, + "callable-types": true, + "no-non-null-assertion": true, + "prefer-object-spread": true, + "object-literal-shorthand": true, + "quotemark": [ + true, + "single", + "avoid-template", + "avoid-escape" + ], + "prefer-template": true, + "no-invalid-template-strings": true, + "increment-decrement": [ + true, + "allow-post" + ], + "binary-expression-operand-order": true, + "no-dynamic-delete": true, + "no-bitwise": true, + "use-isnan": true, + "no-conditional-assignment": true, + "prefer-conditional-expression": [ + true, + "check-else-if" + ], + "prefer-while": true, + "prefer-for-of": true, + "forin": true, + "switch-default": true, + "no-switch-case-fall-through": true, + "no-duplicate-switch-case": true, + "no-unsafe-finally": true, + "encoding": true, + "cyclomatic-complexity": [ + true, + 20 + ], + "indent": [ + true, + "spaces", + 2 + ], + "eofline": true, + "curly": true, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-type-operator", + "check-preblock" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "space-before-function-paren": [ + true, + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always", + "method": "never", + "constructor": "never" + } + ], + "space-within-parens": 0, + "import-spacing": true, + "no-trailing-whitespace": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace", + "check-else", + "check-catch", + "check-finally" + ], + "no-consecutive-blank-lines": [ + true, + 1 + ], + "semicolon": [ + true, + "always", + "strict-bound-class-methods" + ], + "align": [ + true, + "elements", + "members", + "parameters", + "statements" + ], + "trailing-comma": [ + true, + { + "multiline": "always", + "esSpecCompliant": true + } + ], + "file-name-casing": [ + true, + "kebab-case" + ], + "class-name": true, + "interface-name": [ + true, + "never-prefix" + ], + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "comment-type": [ + true, + "singleline", + "doc" + ], + "comment-format": [ + true, + "check-space" + ], + "jsdoc-format": [ + true, + "check-multiline-start" + ], + "no-redundant-jsdoc": true, + "ban-ts-ignore": true, + "no-debugger": true, + "no-eval": true, + "no-string-throw": true, + "no-namespace": true, + "no-internal-module": true, + "number-literal-format": true, + "no-unused-expression": [ + true, + "allow-fast-null-checks" + ], + "no-empty": true, + "no-sparse-arrays": true, + "ban-comma-operator": true + } +} diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.json b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json new file mode 100644 index 000000000..57fa83134 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.json @@ -0,0 +1,17 @@ +{ + "name": "@0xcert/ethereum-order-gateway", + "entries": [ + { + "version": "1.2.0", + "tag": "@0xcert/ethereum-order-gateway_v1.2.0", + "date": "Fri, 22 Mar 2019 09:48:00 GMT", + "comments": {} + }, + { + "version": "1.0.0", + "tag": "@0xcert/ethereum-order-gateway_v1.0.0", + "date": "Thu, 22 Nov 2018 00:51:03 GMT", + "comments": {} + } + ] +} diff --git a/packages/0xcert-wanchain-order-gateway/CHANGELOG.md b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md new file mode 100644 index 000000000..b2eb448ac --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/CHANGELOG.md @@ -0,0 +1,14 @@ +# Change Log - @0xcert/ethereum-order-gateway + +This log was last generated on Fri, 22 Mar 2019 09:48:00 GMT and should not be manually modified. + +## 1.2.0 +Fri, 22 Mar 2019 09:48:00 GMT + +*Version update only* + +## 1.0.0 +Thu, 22 Nov 2018 00:51:03 GMT + +*Initial release* + diff --git a/packages/0xcert-wanchain-order-gateway/README.md b/packages/0xcert-wanchain-order-gateway/README.md new file mode 100644 index 000000000..fa775b434 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/README.md @@ -0,0 +1,7 @@ + + +> Order gateway module for executing atomic operations on the Wanchain blockchain. + +The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details. + +This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues). diff --git a/packages/0xcert-wanchain-order-gateway/nodemon.json b/packages/0xcert-wanchain-order-gateway/nodemon.json new file mode 100644 index 000000000..82b893373 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/nodemon.json @@ -0,0 +1,4 @@ +{ + "ignore": ["dist/*"], + "ext": "js,ts" +} diff --git a/packages/0xcert-wanchain-order-gateway/package.json b/packages/0xcert-wanchain-order-gateway/package.json new file mode 100644 index 000000000..493c2f448 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/package.json @@ -0,0 +1,77 @@ +{ + "name": "@0xcert/wanchain-order-gateway", + "version": "1.2.0", + "description": "Order gateway module for executing atomic operations on the Wanchain blockchain.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "npm run clean && npx tsc", + "clean": "rm -Rf ./dist", + "lint": "npx tslint 'src/**/*.ts?(x)'", + "test": "npm run lint && npx nyc npx hayspec test" + }, + "hayspec": { + "require": [ + "ts-node/register" + ], + "match": [ + "./src/tests/**/*.test.ts" + ] + }, + "nyc": { + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "exclude": [ + "src/tests" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/0xcert/framework.git" + }, + "bugs": { + "url": "https://github.com/0xcert/framework/issues" + }, + "homepage": "https://github.com/0xcert/framework#readme", + "keywords": [ + "0xcert", + "framework", + "protocol", + "asset", + "value", + "values", + "currency", + "token", + "non-fungible", + "fungible", + "erc-721", + "erc-20", + "blockchain", + "javascript", + "typescript", + "nodejs", + "vuejs", + "nuxtjs", + "npm", + "libraries", + "smart-contract", + "wanchain", + "zxc" + ], + "license": "MIT", + "devDependencies": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + }, + "dependencies": { + "@0xcert/ethereum-order-gateway": "1.2.0" + } +} diff --git a/packages/0xcert-wanchain-order-gateway/src/core/gateway.ts b/packages/0xcert-wanchain-order-gateway/src/core/gateway.ts new file mode 100644 index 000000000..386338e24 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/src/core/gateway.ts @@ -0,0 +1,6 @@ +import * as ethereum from '@0xcert/ethereum-order-gateway'; + +/** + * Wanchain order gateway implementation. + */ +export class OrderGateway extends ethereum.OrderGateway {} diff --git a/packages/0xcert-wanchain-order-gateway/src/index.ts b/packages/0xcert-wanchain-order-gateway/src/index.ts new file mode 100644 index 000000000..7828c5ac4 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/src/index.ts @@ -0,0 +1,2 @@ +export { OrderActionKind, Order, OrderGatewayProxy } from '@0xcert/ethereum-order-gateway'; +export * from './core/gateway'; diff --git a/packages/0xcert-wanchain-order-gateway/src/tests/index.test.ts b/packages/0xcert-wanchain-order-gateway/src/tests/index.test.ts new file mode 100644 index 000000000..3b16a0ace --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/src/tests/index.test.ts @@ -0,0 +1,11 @@ +import { Spec } from '@hayspec/spec'; +import * as exchange from '..'; + +const spec = new Spec(); + +spec.test('exposes objects', (ctx) => { + ctx.true(!!exchange.OrderGateway); + ctx.true(!!exchange.Order); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-order-gateway/tsconfig.json b/packages/0xcert-wanchain-order-gateway/tsconfig.json new file mode 100644 index 000000000..4aeac3c20 --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "removeComments": true, + "sourceMap": true, + "outDir": "dist", + "declaration": true, + "experimentalDecorators": true + } +} \ No newline at end of file diff --git a/packages/0xcert-wanchain-order-gateway/tslint.json b/packages/0xcert-wanchain-order-gateway/tslint.json new file mode 100644 index 000000000..c57b3f0cd --- /dev/null +++ b/packages/0xcert-wanchain-order-gateway/tslint.json @@ -0,0 +1,253 @@ +{ + "rules": { + "no-unnecessary-class": [ + true, + "allow-constructor-only", + "allow-static-only", + "allow-empty-class" + ], + "member-access": [ + true, + "check-accessor", + "check-constructor" + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "adjacent-overload-signatures": true, + "prefer-function-over-method": [ + true, + "allow-public", + "allow-protected" + ], + "no-invalid-this": [ + true, + "check-function-in-method" + ], + "no-this-assignment": true, + "unnecessary-constructor": true, + "no-duplicate-super": true, + "new-parens": true, + "no-misused-new": true, + "no-construct": true, + "prefer-method-signature": true, + "interface-over-type-literal": true, + "function-constructor": true, + "no-arg": true, + "arrow-parens": [ + true + ], + "arrow-return-shorthand": [ + false, + "multiline" + ], + "unnecessary-bind": true, + "no-return-await": true, + "prefer-const": true, + "no-var-keyword": true, + "one-variable-per-declaration": [ + true, + "ignore-for-loop" + ], + "no-duplicate-variable": [ + true, + "check-parameters" + ], + "no-unnecessary-initializer": true, + "no-implicit-dependencies": [ + true, + "dev" + ], + "no-import-side-effect": [ + true, + { + "ignore-module": "(hammerjs|core-js|zone.js)" + } + ], + "ordered-imports": [ + true, + { + "import-sources-order": "case-insensitive", + "named-imports-order": "case-insensitive", + "grouped-imports": false + } + ], + "no-duplicate-imports": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "no-reference": true, + "typedef": [ + true, + "property-declaration" + ], + "no-inferrable-types": true, + "no-object-literal-type-assertion": true, + "no-angle-bracket-type-assertion": true, + "callable-types": true, + "no-non-null-assertion": true, + "prefer-object-spread": true, + "object-literal-shorthand": true, + "quotemark": [ + true, + "single", + "avoid-template", + "avoid-escape" + ], + "prefer-template": true, + "no-invalid-template-strings": true, + "increment-decrement": [ + true, + "allow-post" + ], + "binary-expression-operand-order": true, + "no-dynamic-delete": true, + "no-bitwise": true, + "use-isnan": true, + "no-conditional-assignment": true, + "prefer-conditional-expression": [ + true, + "check-else-if" + ], + "prefer-while": true, + "prefer-for-of": true, + "forin": true, + "switch-default": true, + "no-switch-case-fall-through": true, + "no-duplicate-switch-case": true, + "no-unsafe-finally": true, + "encoding": true, + "cyclomatic-complexity": [ + true, + 20 + ], + "indent": [ + true, + "spaces", + 2 + ], + "eofline": true, + "curly": true, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-type-operator", + "check-preblock" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "space-before-function-paren": [ + true, + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always", + "method": "never", + "constructor": "never" + } + ], + "space-within-parens": 0, + "import-spacing": true, + "no-trailing-whitespace": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace", + "check-else", + "check-catch", + "check-finally" + ], + "no-consecutive-blank-lines": [ + true, + 1 + ], + "semicolon": [ + true, + "always", + "strict-bound-class-methods" + ], + "align": [ + true, + "elements", + "members", + "parameters", + "statements" + ], + "trailing-comma": [ + true, + { + "multiline": "always", + "esSpecCompliant": true + } + ], + "file-name-casing": [ + true, + "kebab-case" + ], + "class-name": true, + "interface-name": [ + true, + "never-prefix" + ], + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "comment-type": [ + true, + "singleline", + "doc" + ], + "comment-format": [ + true, + "check-space" + ], + "jsdoc-format": [ + true, + "check-multiline-start" + ], + "no-redundant-jsdoc": true, + "ban-ts-ignore": true, + "no-debugger": true, + "no-eval": true, + "no-string-throw": true, + "no-namespace": true, + "no-internal-module": true, + "number-literal-format": true, + "no-unused-expression": [ + true, + "allow-fast-null-checks" + ], + "no-empty": true, + "no-sparse-arrays": true, + "ban-comma-operator": true + } +} diff --git a/packages/0xcert-wanchain-utils/README.md b/packages/0xcert-wanchain-utils/README.md new file mode 100644 index 000000000..d065e4f24 --- /dev/null +++ b/packages/0xcert-wanchain-utils/README.md @@ -0,0 +1,74 @@ + + +> General Ethereum utility module with helper functions for the Ethereum blockchain. + +The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details. + +This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues). + +# Ethereum Utilities + +This module wraps several useful Ethereum functions which will be useful through the 0xcert Framework. Currently supported are these functions and classes from [ethers.js](https://github.com/ethers-io/ethers.js): + +## ABI coder + +This converts value to and from the packed [Ethereum ABI encoding](https://solidity.readthedocs.io/en/develop/abi-spec.html#formal-specification-of-the-encoding). + +* `encodeParameters`(types: `any`, values: `Array`): `string` +* `decodeParameters`(types: `any`, data: `any`): `any` + +**Encoding example:** + +```ts +import { decodeParameters, encodeParameters } from '0xcert/ethereum-utils/abi'; + +const types = ['tuple(uint256, uint256[])']; +const values = [[ 42, [ 45 ] ]]; +const encodedValues = encodeParameters(types, values); +``` + +**Decoding example:** + +```ts +import { decodeParameters, encodeParameters } from '0xcert/ethereum-utils/abi'; + +const types = ['tuple(uint256, uint256[])']; +const encoded = '0x' + + '0000000000000000000000000000000000000000000000000000000000000020' + + '000000000000000000000000000000000000000000000000000000000000002a' + + '0000000000000000000000000000000000000000000000000000000000000040' + + '0000000000000000000000000000000000000000000000000000000000000001' + + '000000000000000000000000000000000000000000000000000000000000002d'; +const values = decodeParameters(types, values); +``` + +## BigNumber and bigNumberify + +Here is a basic example adapted from [the ethers.js documentation](https://docs.ethers.io/ethers.js/html/api-utils.html?highlight=bignumberify#big-numbers). + +```ts +import { BigNumber, bigNumberify } from '0xcert/ethereum-utils/big-number'; + +let gasPriceWei = bigNumberify("20902747399"); +let gasLimit = bigNumberify(3000000); + +let maxCostWei = gasPriceWei.mul(gasLimit) +console.log("Max Cost: " + maxCostWei.toString()); +// "Max Cost: 62708242197000000" + +console.log("Number: " + maxCostWei.toNumber()); +// throws an Error, the value is too large for JavaScript to handle safely +``` + +## Address normalization + +The ethers.js [address normalization function](https://docs.ethers.io/ethers.js/html/api-utils.html?highlight=getaddress#addresses) implements [EIP-55 Mixed-case checksum address encoding](https://eips.ethereum.org/EIPS/eip-55). + + +```ts +import { getAddress } from '0xcert/ethereum-utils/normalize-address'; + +let zxcTokenAddress = '0x83e2be8d114f9661221384b3a50d24b96a5653f5'; +let zxcTokenAddressNormalized = normalizeAddress(zxcToenAddress); +// 0x83e2BE8d114F9661221384B3a50d24B96a5653F5 +``` \ No newline at end of file diff --git a/packages/0xcert-wanchain-utils/nodemon.json b/packages/0xcert-wanchain-utils/nodemon.json new file mode 100644 index 000000000..82b893373 --- /dev/null +++ b/packages/0xcert-wanchain-utils/nodemon.json @@ -0,0 +1,4 @@ +{ + "ignore": ["dist/*"], + "ext": "js,ts" +} diff --git a/packages/0xcert-wanchain-utils/package.json b/packages/0xcert-wanchain-utils/package.json new file mode 100644 index 000000000..238eae13b --- /dev/null +++ b/packages/0xcert-wanchain-utils/package.json @@ -0,0 +1,77 @@ +{ + "name": "@0xcert/wanchain-utils", + "version": "1.2.0", + "description": "General Wanchain utility module with helper functions for the Wanchain blockchain.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "npm run clean && npx tsc", + "clean": "rm -Rf ./dist", + "lint": "npx tslint 'src/**/*.ts?(x)'", + "test": "npm run lint && npx nyc npx hayspec test" + }, + "hayspec": { + "require": [ + "ts-node/register" + ], + "match": [ + "./src/tests/**/*.test.ts" + ] + }, + "nyc": { + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "exclude": [ + "src/tests" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/0xcert/framework.git" + }, + "bugs": { + "url": "https://github.com/0xcert/framework/issues" + }, + "homepage": "https://github.com/0xcert/framework#readme", + "keywords": [ + "0xcert", + "framework", + "protocol", + "asset", + "value", + "values", + "currency", + "token", + "non-fungible", + "fungible", + "erc-721", + "erc-20", + "blockchain", + "javascript", + "typescript", + "nodejs", + "vuejs", + "nuxtjs", + "npm", + "libraries", + "smart-contract", + "wanchain", + "zxc" + ], + "license": "MIT", + "devDependencies": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + }, + "dependencies": { + "ethers": "4.0.0-beta.1", + "@0xcert/ethereum-utils": "1.2.0" + } +} diff --git a/packages/0xcert-wanchain-utils/src/index.ts b/packages/0xcert-wanchain-utils/src/index.ts new file mode 100644 index 000000000..db0ca8add --- /dev/null +++ b/packages/0xcert-wanchain-utils/src/index.ts @@ -0,0 +1 @@ +export * from './lib/encoder'; diff --git a/packages/0xcert-wanchain-utils/src/lib/encoder.ts b/packages/0xcert-wanchain-utils/src/lib/encoder.ts new file mode 100644 index 000000000..6552af3d1 --- /dev/null +++ b/packages/0xcert-wanchain-utils/src/lib/encoder.ts @@ -0,0 +1,55 @@ +import { Encode } from '@0xcert/ethereum-utils'; +import { AbiCoder } from 'ethers/utils/abi-coder'; +// import { getAddress } from 'ethers/utils/address'; + +export class Encoder implements Encode { + + private coder: AbiCoder = new AbiCoder(); + + /** + * Encodes parameters for smart contract call. + * @param types Input types. + * @param values Input values. + */ + public encodeParameters(types: any, values: Array): string { + return this.coder.encode(types, values); + } + + /** + * Decodes parameters from smart contract return. + * @param types Output types. + * @param data Output data. + */ + public decodeParameters(types: any, data: any): any { + return this.coder.decode(types, data); + } + + /** + * Converts Wanchain address to checksum format. + * NOTE: Wanchain uses basically the same mechanism, you only have to inverse + * lower and upper case on characters. + */ + public normalizeAddress(address: string): string { + if (!address) { + return null; + } + + // We are using ethers.js for encoding ABI calls. This means that if we send using a Wanchain address, + // ethers.js will throw an error. Ethers.js 5.0 with subclassing will be available in the following + // weeks. Until then we just write the address in lowercase and let Ethers.js do its thing. Because of + // this there is a danger of executing a transaction to an Ethereum address since there is no checksum check. + + return address.toLowerCase(); + + // address = normalizeEthereumAddress(address.toLowerCase()); + + // return [ + // '0x', + // ...address.substr(2).split('').map((character) => { + // return character == character.toLowerCase() + // ? character.toUpperCase() + // : character.toLowerCase(); + // }), + // ].join('');*/ + } +} diff --git a/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts b/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts new file mode 100644 index 000000000..05c16e92f --- /dev/null +++ b/packages/0xcert-wanchain-utils/src/tests/normalize-address.test.ts @@ -0,0 +1,16 @@ +import { Spec } from '@hayspec/spec'; +import { Encoder } from '../lib/encoder'; + +const spec = new Spec(); + +spec.test('normalize address', (ctx) => { + const encoder = new Encoder(); + // ctx.is(normalizeAddress('0xE96D860C8BBB30F6831E6E65D327295B7A0C524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('0xe96d860c8bbb30f6831e6e65d327295b7a0c524f'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + // ctx.is(normalizeAddress('E96d860c8bbb30f6831e6e65D327295b7a0c524F'), '0xE96d860c8bbb30f6831e6e65D327295b7a0c524F'); + ctx.is(encoder.normalizeAddress(null), null); + // ctx.throws(() => normalizeAddress('dfg')); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-utils/tsconfig.json b/packages/0xcert-wanchain-utils/tsconfig.json new file mode 100644 index 000000000..4aeac3c20 --- /dev/null +++ b/packages/0xcert-wanchain-utils/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "removeComments": true, + "sourceMap": true, + "outDir": "dist", + "declaration": true, + "experimentalDecorators": true + } +} \ No newline at end of file diff --git a/packages/0xcert-wanchain-utils/tslint.json b/packages/0xcert-wanchain-utils/tslint.json new file mode 100644 index 000000000..c57b3f0cd --- /dev/null +++ b/packages/0xcert-wanchain-utils/tslint.json @@ -0,0 +1,253 @@ +{ + "rules": { + "no-unnecessary-class": [ + true, + "allow-constructor-only", + "allow-static-only", + "allow-empty-class" + ], + "member-access": [ + true, + "check-accessor", + "check-constructor" + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "adjacent-overload-signatures": true, + "prefer-function-over-method": [ + true, + "allow-public", + "allow-protected" + ], + "no-invalid-this": [ + true, + "check-function-in-method" + ], + "no-this-assignment": true, + "unnecessary-constructor": true, + "no-duplicate-super": true, + "new-parens": true, + "no-misused-new": true, + "no-construct": true, + "prefer-method-signature": true, + "interface-over-type-literal": true, + "function-constructor": true, + "no-arg": true, + "arrow-parens": [ + true + ], + "arrow-return-shorthand": [ + false, + "multiline" + ], + "unnecessary-bind": true, + "no-return-await": true, + "prefer-const": true, + "no-var-keyword": true, + "one-variable-per-declaration": [ + true, + "ignore-for-loop" + ], + "no-duplicate-variable": [ + true, + "check-parameters" + ], + "no-unnecessary-initializer": true, + "no-implicit-dependencies": [ + true, + "dev" + ], + "no-import-side-effect": [ + true, + { + "ignore-module": "(hammerjs|core-js|zone.js)" + } + ], + "ordered-imports": [ + true, + { + "import-sources-order": "case-insensitive", + "named-imports-order": "case-insensitive", + "grouped-imports": false + } + ], + "no-duplicate-imports": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "no-reference": true, + "typedef": [ + true, + "property-declaration" + ], + "no-inferrable-types": true, + "no-object-literal-type-assertion": true, + "no-angle-bracket-type-assertion": true, + "callable-types": true, + "no-non-null-assertion": true, + "prefer-object-spread": true, + "object-literal-shorthand": true, + "quotemark": [ + true, + "single", + "avoid-template", + "avoid-escape" + ], + "prefer-template": true, + "no-invalid-template-strings": true, + "increment-decrement": [ + true, + "allow-post" + ], + "binary-expression-operand-order": true, + "no-dynamic-delete": true, + "no-bitwise": true, + "use-isnan": true, + "no-conditional-assignment": true, + "prefer-conditional-expression": [ + true, + "check-else-if" + ], + "prefer-while": true, + "prefer-for-of": true, + "forin": true, + "switch-default": true, + "no-switch-case-fall-through": true, + "no-duplicate-switch-case": true, + "no-unsafe-finally": true, + "encoding": true, + "cyclomatic-complexity": [ + true, + 20 + ], + "indent": [ + true, + "spaces", + 2 + ], + "eofline": true, + "curly": true, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-type-operator", + "check-preblock" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "space-before-function-paren": [ + true, + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always", + "method": "never", + "constructor": "never" + } + ], + "space-within-parens": 0, + "import-spacing": true, + "no-trailing-whitespace": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace", + "check-else", + "check-catch", + "check-finally" + ], + "no-consecutive-blank-lines": [ + true, + 1 + ], + "semicolon": [ + true, + "always", + "strict-bound-class-methods" + ], + "align": [ + true, + "elements", + "members", + "parameters", + "statements" + ], + "trailing-comma": [ + true, + { + "multiline": "always", + "esSpecCompliant": true + } + ], + "file-name-casing": [ + true, + "kebab-case" + ], + "class-name": true, + "interface-name": [ + true, + "never-prefix" + ], + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "comment-type": [ + true, + "singleline", + "doc" + ], + "comment-format": [ + true, + "check-space" + ], + "jsdoc-format": [ + true, + "check-multiline-start" + ], + "no-redundant-jsdoc": true, + "ban-ts-ignore": true, + "no-debugger": true, + "no-eval": true, + "no-string-throw": true, + "no-namespace": true, + "no-internal-module": true, + "number-literal-format": true, + "no-unused-expression": [ + true, + "allow-fast-null-checks" + ], + "no-empty": true, + "no-sparse-arrays": true, + "ban-comma-operator": true + } +} diff --git a/packages/0xcert-wanchain-value-ledger/README.md b/packages/0xcert-wanchain-value-ledger/README.md new file mode 100644 index 000000000..f2cbfe4fe --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/README.md @@ -0,0 +1,7 @@ + + +> Value ledger module for currency management on the Wanchain blockchain. + +The [0xcert Framework](https://docs.0xcert.org) is a free and open-source JavaScript library that provides tools for building powerful decentralized applications. Please refer to the [official documentation](https://docs.0xcert.org) for more details. + +This module is one of the bricks of the [0xcert Framework](https://docs.0xcert.org). It's written with [TypeScript](https://www.typescriptlang.org) and it's actively maintained. The source code is available on [GitHub](https://github.com/0xcert/framework) where you can also find our [issue tracker](https://github.com/0xcert/framework/issues). diff --git a/packages/0xcert-wanchain-value-ledger/nodemon.json b/packages/0xcert-wanchain-value-ledger/nodemon.json new file mode 100644 index 000000000..82b893373 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/nodemon.json @@ -0,0 +1,4 @@ +{ + "ignore": ["dist/*"], + "ext": "js,ts" +} diff --git a/packages/0xcert-wanchain-value-ledger/package.json b/packages/0xcert-wanchain-value-ledger/package.json new file mode 100644 index 000000000..0ca15a7a2 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/package.json @@ -0,0 +1,77 @@ +{ + "name": "@0xcert/wanchain-value-ledger", + "version": "1.2.0", + "description": "Value ledger module for currency management on the Wanchain blockchain.", + "main": "./dist/index.js", + "types": "./dist/index.d.ts", + "scripts": { + "build": "npm run clean && npx tsc", + "clean": "rm -Rf ./dist", + "lint": "npx tslint 'src/**/*.ts?(x)'", + "test": "npm run lint && npx nyc npx hayspec test" + }, + "hayspec": { + "require": [ + "ts-node/register" + ], + "match": [ + "./src/tests/**/*.test.ts" + ] + }, + "nyc": { + "extension": [ + ".ts" + ], + "require": [ + "ts-node/register" + ], + "exclude": [ + "src/tests" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/0xcert/framework.git" + }, + "bugs": { + "url": "https://github.com/0xcert/framework/issues" + }, + "homepage": "https://github.com/0xcert/framework#readme", + "keywords": [ + "0xcert", + "framework", + "protocol", + "asset", + "value", + "values", + "currency", + "token", + "non-fungible", + "fungible", + "erc-721", + "erc-20", + "blockchain", + "javascript", + "typescript", + "nodejs", + "vuejs", + "nuxtjs", + "npm", + "libraries", + "smart-contract", + "wanchain", + "zxc" + ], + "license": "MIT", + "devDependencies": { + "@hayspec/cli": "^0.8.3", + "@hayspec/spec": "^0.8.3", + "nyc": "^13.1.0", + "ts-node": "^7.0.1", + "tslint": "^5.12.1", + "typescript": "^3.1.1" + }, + "dependencies": { + "@0xcert/ethereum-value-ledger": "1.2.0" + } +} diff --git a/packages/0xcert-wanchain-value-ledger/src/core/ledger.ts b/packages/0xcert-wanchain-value-ledger/src/core/ledger.ts new file mode 100644 index 000000000..d7c496281 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/src/core/ledger.ts @@ -0,0 +1,6 @@ +import * as ethereum from '@0xcert/ethereum-value-ledger'; + +/** + * Wanchain value ledger implementation. + */ +export class ValueLedger extends ethereum.ValueLedger {} diff --git a/packages/0xcert-wanchain-value-ledger/src/index.ts b/packages/0xcert-wanchain-value-ledger/src/index.ts new file mode 100644 index 000000000..9fac26456 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/src/index.ts @@ -0,0 +1,2 @@ +export { ValueLedgerDeployRecipe, ValueLedgerInfo, ValueLedgerTransferRecipe } from '@0xcert/ethereum-value-ledger'; +export * from './core/ledger'; diff --git a/packages/0xcert-wanchain-value-ledger/src/tests/index.test.ts b/packages/0xcert-wanchain-value-ledger/src/tests/index.test.ts new file mode 100644 index 000000000..9bebb563e --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/src/tests/index.test.ts @@ -0,0 +1,10 @@ +import { Spec } from '@hayspec/spec'; +import * as ledger from '..'; + +const spec = new Spec(); + +spec.test('exposes objects', (ctx) => { + ctx.true(!!ledger.ValueLedger); +}); + +export default spec; diff --git a/packages/0xcert-wanchain-value-ledger/tsconfig.json b/packages/0xcert-wanchain-value-ledger/tsconfig.json new file mode 100644 index 000000000..4aeac3c20 --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/tsconfig.json @@ -0,0 +1,12 @@ +{ + "compilerOptions": { + "module": "commonjs", + "target": "es6", + "noImplicitAny": false, + "removeComments": true, + "sourceMap": true, + "outDir": "dist", + "declaration": true, + "experimentalDecorators": true + } +} \ No newline at end of file diff --git a/packages/0xcert-wanchain-value-ledger/tslint.json b/packages/0xcert-wanchain-value-ledger/tslint.json new file mode 100644 index 000000000..c57b3f0cd --- /dev/null +++ b/packages/0xcert-wanchain-value-ledger/tslint.json @@ -0,0 +1,253 @@ +{ + "rules": { + "no-unnecessary-class": [ + true, + "allow-constructor-only", + "allow-static-only", + "allow-empty-class" + ], + "member-access": [ + true, + "check-accessor", + "check-constructor" + ], + "member-ordering": [ + true, + "public-before-private", + "static-before-instance", + "variables-before-functions" + ], + "adjacent-overload-signatures": true, + "prefer-function-over-method": [ + true, + "allow-public", + "allow-protected" + ], + "no-invalid-this": [ + true, + "check-function-in-method" + ], + "no-this-assignment": true, + "unnecessary-constructor": true, + "no-duplicate-super": true, + "new-parens": true, + "no-misused-new": true, + "no-construct": true, + "prefer-method-signature": true, + "interface-over-type-literal": true, + "function-constructor": true, + "no-arg": true, + "arrow-parens": [ + true + ], + "arrow-return-shorthand": [ + false, + "multiline" + ], + "unnecessary-bind": true, + "no-return-await": true, + "prefer-const": true, + "no-var-keyword": true, + "one-variable-per-declaration": [ + true, + "ignore-for-loop" + ], + "no-duplicate-variable": [ + true, + "check-parameters" + ], + "no-unnecessary-initializer": true, + "no-implicit-dependencies": [ + true, + "dev" + ], + "no-import-side-effect": [ + true, + { + "ignore-module": "(hammerjs|core-js|zone.js)" + } + ], + "ordered-imports": [ + true, + { + "import-sources-order": "case-insensitive", + "named-imports-order": "case-insensitive", + "grouped-imports": false + } + ], + "no-duplicate-imports": true, + "import-blacklist": [ + true, + "rxjs/Rx" + ], + "no-reference": true, + "typedef": [ + true, + "property-declaration" + ], + "no-inferrable-types": true, + "no-object-literal-type-assertion": true, + "no-angle-bracket-type-assertion": true, + "callable-types": true, + "no-non-null-assertion": true, + "prefer-object-spread": true, + "object-literal-shorthand": true, + "quotemark": [ + true, + "single", + "avoid-template", + "avoid-escape" + ], + "prefer-template": true, + "no-invalid-template-strings": true, + "increment-decrement": [ + true, + "allow-post" + ], + "binary-expression-operand-order": true, + "no-dynamic-delete": true, + "no-bitwise": true, + "use-isnan": true, + "no-conditional-assignment": true, + "prefer-conditional-expression": [ + true, + "check-else-if" + ], + "prefer-while": true, + "prefer-for-of": true, + "forin": true, + "switch-default": true, + "no-switch-case-fall-through": true, + "no-duplicate-switch-case": true, + "no-unsafe-finally": true, + "encoding": true, + "cyclomatic-complexity": [ + true, + 20 + ], + "indent": [ + true, + "spaces", + 2 + ], + "eofline": true, + "curly": true, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-type", + "check-typecast", + "check-type-operator", + "check-preblock" + ], + "typedef-whitespace": [ + true, + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ], + "space-before-function-paren": [ + true, + { + "anonymous": "never", + "named": "never", + "asyncArrow": "always", + "method": "never", + "constructor": "never" + } + ], + "space-within-parens": 0, + "import-spacing": true, + "no-trailing-whitespace": true, + "one-line": [ + true, + "check-open-brace", + "check-whitespace", + "check-else", + "check-catch", + "check-finally" + ], + "no-consecutive-blank-lines": [ + true, + 1 + ], + "semicolon": [ + true, + "always", + "strict-bound-class-methods" + ], + "align": [ + true, + "elements", + "members", + "parameters", + "statements" + ], + "trailing-comma": [ + true, + { + "multiline": "always", + "esSpecCompliant": true + } + ], + "file-name-casing": [ + true, + "kebab-case" + ], + "class-name": true, + "interface-name": [ + true, + "never-prefix" + ], + "variable-name": [ + true, + "check-format", + "allow-leading-underscore", + "ban-keywords" + ], + "comment-type": [ + true, + "singleline", + "doc" + ], + "comment-format": [ + true, + "check-space" + ], + "jsdoc-format": [ + true, + "check-multiline-start" + ], + "no-redundant-jsdoc": true, + "ban-ts-ignore": true, + "no-debugger": true, + "no-eval": true, + "no-string-throw": true, + "no-namespace": true, + "no-internal-module": true, + "number-literal-format": true, + "no-unused-expression": [ + true, + "allow-fast-null-checks" + ], + "no-empty": true, + "no-sparse-arrays": true, + "ban-comma-operator": true + } +} diff --git a/packages/0xcert-webpack/package.json b/packages/0xcert-webpack/package.json index bbe775e7d..fe19c41d2 100644 --- a/packages/0xcert-webpack/package.json +++ b/packages/0xcert-webpack/package.json @@ -15,6 +15,10 @@ "@0xcert/ethereum-metamask-provider": "1.3.0", "@0xcert/ethereum-order-gateway": "1.3.0", "@0xcert/ethereum-value-ledger": "1.3.0", + "@0xcert/wanchain-order-gateway": "1.3.0", + "@0xcert/wanchain-value-ledger": "1.3.0", + "@0xcert/wanchain-asset-ledger": "1.3.0", + "@0xcert/wanchain-http-provider": "1.3.0", "webpack": "^4.25.0", "webpack-cli": "^3.1.2" } diff --git a/packages/0xcert-webpack/src/0xcert-wanchain-asset-ledger.js b/packages/0xcert-webpack/src/0xcert-wanchain-asset-ledger.js new file mode 100644 index 000000000..93a1baa0e --- /dev/null +++ b/packages/0xcert-webpack/src/0xcert-wanchain-asset-ledger.js @@ -0,0 +1,6 @@ +window.$0xcert = window.$0xcert || {}; + +Object.assign( + window.$0xcert, + require('@0xcert/wanchain-asset-ledger'), +); diff --git a/packages/0xcert-webpack/src/0xcert-wanchain-http-provider.js b/packages/0xcert-webpack/src/0xcert-wanchain-http-provider.js new file mode 100644 index 000000000..f96fc5c5d --- /dev/null +++ b/packages/0xcert-webpack/src/0xcert-wanchain-http-provider.js @@ -0,0 +1,6 @@ +window.$0xcert = window.$0xcert || {}; + +Object.assign( + window.$0xcert, + require('@0xcert/wanchain-http-provider'), +); diff --git a/packages/0xcert-webpack/src/0xcert-wanchain-order-gateway.js b/packages/0xcert-webpack/src/0xcert-wanchain-order-gateway.js new file mode 100644 index 000000000..7672458fb --- /dev/null +++ b/packages/0xcert-webpack/src/0xcert-wanchain-order-gateway.js @@ -0,0 +1,6 @@ +window.$0xcert = window.$0xcert || {}; + +Object.assign( + window.$0xcert, + require('@0xcert/wanchain-order-gateway'), +); diff --git a/packages/0xcert-webpack/src/0xcert-wanchain-value-ledger.js b/packages/0xcert-webpack/src/0xcert-wanchain-value-ledger.js new file mode 100644 index 000000000..0991a5677 --- /dev/null +++ b/packages/0xcert-webpack/src/0xcert-wanchain-value-ledger.js @@ -0,0 +1,6 @@ +window.$0xcert = window.$0xcert || {}; + +Object.assign( + window.$0xcert, + require('@0xcert/wanchain-value-ledger'), +); diff --git a/packages/0xcert-webpack/src/0xcert-wanchain.js b/packages/0xcert-webpack/src/0xcert-wanchain.js new file mode 100644 index 000000000..74cae62e2 --- /dev/null +++ b/packages/0xcert-webpack/src/0xcert-wanchain.js @@ -0,0 +1,9 @@ +window.$0xcert = window.$0xcert || {}; + +Object.assign( + window.$0xcert, + require('@0xcert/cert'), + require('@0xcert/wanchain-asset-ledger'), + require('@0xcert/wanchain-order-gateway'), + require('@0xcert/wanchain-value-ledger'), +); diff --git a/packages/0xcert-webpack/webpack.config.js b/packages/0xcert-webpack/webpack.config.js index ad9c2830c..989346f41 100644 --- a/packages/0xcert-webpack/webpack.config.js +++ b/packages/0xcert-webpack/webpack.config.js @@ -8,7 +8,12 @@ module.exports = { '0xcert-ethereum-metamask-provider': './src/0xcert-ethereum-metamask-provider.js', '0xcert-ethereum-order-gateway': './src/0xcert-ethereum-order-gateway.js', '0xcert-ethereum-value-ledger': './src/0xcert-ethereum-value-ledger.js', + '0xcert-wanchain-asset-ledger': './src/0xcert-wanchain-asset-ledger.js', + '0xcert-wanchain-http-provider': './src/0xcert-wanchain-http-provider.js', + '0xcert-wanchain-order-gateway': './src/0xcert-wanchain-order-gateway.js', + '0xcert-wanchain-value-ledger': './src/0xcert-wanchain-value-ledger.js', '0xcert-ethereum': './src/0xcert-ethereum.js', + '0xcert-wanchain': './src/0xcert-wanchain.js', }, output: { filename: `[name].min.js`, diff --git a/rush.json b/rush.json index b8523a047..680048456 100644 --- a/rush.json +++ b/rush.json @@ -121,6 +121,31 @@ "packageName": "@0xcert/webpack", "projectFolder": "packages/0xcert-webpack", "shouldPublish": false + }, + { + "packageName": "@0xcert/wanchain-asset-ledger", + "projectFolder": "packages/0xcert-wanchain-asset-ledger", + "versionPolicyName": "patchAll" + }, + { + "packageName": "@0xcert/wanchain-http-provider", + "projectFolder": "packages/0xcert-wanchain-http-provider", + "versionPolicyName": "patchAll" + }, + { + "packageName": "@0xcert/wanchain-order-gateway", + "projectFolder": "packages/0xcert-wanchain-order-gateway", + "versionPolicyName": "patchAll" + }, + { + "packageName": "@0xcert/wanchain-utils", + "projectFolder": "packages/0xcert-wanchain-utils", + "versionPolicyName": "patchAll" + }, + { + "packageName": "@0xcert/wanchain-value-ledger", + "projectFolder": "packages/0xcert-wanchain-value-ledger", + "versionPolicyName": "patchAll" } ] }